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?
Answer Posted / 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 View All Answers
Can you sort a string in java?
What is the difference between @before and @beforeclass annotation?
Can we execute java program without main method?
Can you run java program without main method?
What is currentthread()?
Define a java class.
What is oop in java?
What is the difference between the paint() and repaint() methods?
What is a flag value?
How does sublist works in java?
What is a lock or purpose of locks in java?
Which list is sorted in java?
Why local variables are stored in stack?
What is the format specifier?
What do you mean Abstraction in java?