What are inner and anonymous class?

Answer Posted / janet

Inner Class: classes defined in other classes ,including
those defined in methods are called inner classes.
An inner class can have any accessiblity including private.

Anonumous class: Anonymous class is a class defined inside
a method without a name and is instantiated and declared in
the same place and cannot have explicit constructors.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a parent class in java?

539


What are memory tables?

605


How do you sort a list in java?

574


How do you include a string in java?

522


If an application has multiple classes in it, is it okay to have a main method in more than one class?

534






Can size_t be negative?

608


Why is core java important?

570


What are the parts of a method?

533


What are the disadvantages of object oriented programming?

588


Is it possible to override private or static method in java?

540


Java is pass by value or pass by reference? Explain

530


What is method in java ?

621


Explain oops concepts in detail?

574


What is operator overloading. Is it is supported in java?

516


What is anonymous inner class?

609