File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes anonymous classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "anonymous classes" Watch "anonymous classes" New topic
Author

anonymous classes

rachana ravali
Ranch Hand

Joined: Jun 20, 2006
Posts: 32
can an anonymous class extend a class or implement an interface?
please explain to me.
i am new to java.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36501
    
  16
Welcome to the Ranch.

The short answer to both your questions is yes. In fact if it doesn't do one or the other, you have to give it a name, and it ceases to be anonymous.

You will find this is discussed many a time on the Ranch; different people have different opinions. Look at this thread in the advanced forum, for example.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: anonymous classes
 
Similar Threads
Anonymous class ???
What is this technique called?
Passing an object to a method.
object of an interface? Hows possible
Is it possible to create a class like this