How to create the object to the anonomous class

Questions by sadashivarao   answers by sadashivarao

Showing Answers 1 - 1 of 1 Answers

vsolanke

  • Aug 13th, 2006
 

Anonymous classes are classes that don?t have a name (hence the term anonymous). Because they don?t have a name, there is no way to refer to them. For this reason, their declaration must be given at creation time, as part of the new statement.That requires yet another form of the new statement, as follows:new This form of the new statement declares a new anonymous class that extends a given class or implements a given interface. It also creates a new instance of that class and returns it as the result of the statement. The class to extend or the interface to implement is the operand of the new statement, followed by the anonymous class? body.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions