What is anonymous class?

Answer Posted / rimjhim

it is a local inner class without any name.
it is instantiated at the time of declaration and must be
extended by a class or implemented by an interface.

new [class name](argument list){anonymous class body};

overridden functions can be declared in this calss and it
can have only one new method inside it.more than one can
not be called anywhere.
using dot operator we can call that new function.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java util?

537


What is a numeric literal?

521


what happens when a thread cannot acquire a lock on an object? : Java thread

536


Explain the inheritance?

572


Explain implementation and how is it different from conversion?

583






When is update method called?

668


What is rule of accessibility in java?

540


What are new features introduced with java 8 ?

548


What are static methods?

574


What is the collections api in java programming?

548


How do you sort in descending order in java using collections sort?

492


What is Mutex (Mutual Exclusion Object) ?

623


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

617


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

504


What are java threads?

615