What are inner and anonymous class?

Answer Posted / harika.thota001@gmail.com

Inner Class in java so called nested class is nothing but a class that is being defined inside another class. Inner classes are beneficial in two scenarios i.e. access control and naming control. Although these benefits can be acquired using java packages.

anonymous class is an inner class that does not have a name at all. And whose instance is being created at the time of its creation.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What data structures are used to perform recursion?

598


Do we have pointers in java?

522


What is the instance of an object?

543


How to make a class or a bean serializable?

537


What does a za z0 9 mean?

558






Why is java so important?

643


What is the difference between variable & constant?

536


Is a case study a method or methodology?

459


Why is boolean important?

582


What is string syntax?

544


What is the difference between synchronized and synchronized block?

496


What is continuity of a function?

517


how to write a program for sending mails between client and server

1542


How to overcome the exception object reference not set to an instance of object?

612


What is balanced tree in java?

524