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 difference between protected and private?

522


What does arrays sort do in java?

532


How does callback work in java?

599


What is a treeset class?

550


What are JVM.JRE, J2EE, JNI?

682






What is treemap in java?

546


What is difference between local variable and global variable?

467


Which is bigger double or float?

522


What are the different types of inheritance in java?

522


Can we sort array in java?

523


Can two objects have same hashcode?

560


What is the size of string?

552


How do you sort a set in java?

511


Can we have a try block without catch block?

560


What are the characteristics of java?

518