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

Where are variables stored?

637


Can we use return in constructor?

574


Can java list contain duplicates?

662


Where import statement is used in a java program?

684


What does super keyword do?

648






What does jenkins do?

569


Define locale.

678


Can you instantiate the math class in Java?

701


What is java in detail?

687


Does java isempty check for null?

665


Can constructor return value?

626


Why do we need singleton?

622


Can we assign the reference to this variable?

633


What is the size of integer?

683


What is difference between hashset and hashmap in java?

560