What is inner class?what is the use of inner class?where we
create the object for inner class? and inner class can
extend any class or inner class can implement any interface?



What is inner class?what is the use of inner class?where we create the object for inner class? and ..

Answer / gajendar

In Java, just like methods, variables of a class too can have another class as its member. Writing a class within another is allowed in Java. The class written within is called the nested class, and the class that holds the inner class is called the outer class.
we can create object for inner class in methods of outer class.it can extend exactly 1 class or impliment 1 interface

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

How does marker interface provides functionality to the implemented class ? or How dose maker interface gets the functionalities as serialization or cloning.

4 Answers   Cap Gemini,


Is ++ operator is thread safe in java?

0 Answers  


Which package is imported by default?

0 Answers  


What is meant by string is immutable?

0 Answers  


What is bubble sorting in java?

0 Answers  


What is the purpose of the finally clause?

3 Answers  


How does the java compiler work?

0 Answers  


What are the Abstract Classes provided by Java?

5 Answers   Oracle,


Hi friends, i am new to java. can you explain how java is secured.

2 Answers  


How are multiple inheritances done in Java?

0 Answers   Atos Origin,


What is the difference between method and means?

0 Answers  


What is the difference between the >> and >>> operators?

1 Answers  


Categories