Is it possible to declare an anonymous class while implementing an interface?

Showing Answers 1 - 2 of 2 Answers

Riya

  • Dec 30th, 2005
 

Ya it is !!

Runnable r = new Runnable(){}

  Was this answer useful?  Yes

Sumit Sengar

  • Feb 3rd, 2007
 

Interface i = new Interface(){/* Code}The above statement creates an instance of a class which implements the Interface "Interface". As name of class is not specified hence it is anonymous.

  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