What is anonymous class?

Answer Posted / niranjanravi

An Anonymous class is a class which is defined at run time
without having any name and it is instantiated and declared
at the same place.
Syntax:
new class classname(){}
new interface interfacename(){}
Keyword extends and implements are usedin this class.
It is always implicitly final.
It is never static or final.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are there structures in java?

552


what is mena by object block any what is the use of that

1770


What is flag in python?

551


What are the types of java languages?

515


What is protected in java?

521






What is size of int in java?

543


Which number is denoted by leading zero in java?

803


Can we execute a program without main() method?

529


What is the difference between Java and C++?

613


Explain the difference between arraylist and linkedlist in java?

484


Can we restart a thread already started in java?

580


Can constructor be inherited?

575


Why webdriver is an interface?

577


What are the steps in the jdbc connection?

572


What is difference between hashset and hashmap in java?

460