Is this code legal in java i.e nested class within interface implementing the parent interface ? <br /> <br /> public interface MyInterface {<br /> public class MyClass implements MyInterface {<br /> }<br /> }
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. Is this code legal in java i.e nested class within interface implementing the parent interface ?

public interface MyInterface {
public class MyClass implements MyInterface {
}
}
Core Java
Ans. Yes that's legal in java

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     inner classes  nested classes  sub class      Basic


Related Questions

 Which of the following can be marked static ?

a. Methods , Variables and Initialization Blocks.
b. Methods , Variables , Initialization Blocks and Outer Classes and nested Classes.
c. Methods , Variables , Initialization Blocks and Outer Classes.
d. Methods , Variables , Initialization Blocks and nested Classes
 What is the difference between inner class and sub class ?
  Difference between nested and inner classes ?
  What is a nested interface ?
  Which of the following cannot be marked static ?
  Explain use of nested or inner classes ?
  What is the benefit of inner / nested classes ?
  Explain Static nested Classes ?
 Can we have an inner class within Interface ?
 Upon compiling the following class, What .class files will get created

public class OuterClass{
class InnerClass{
}
}



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: