This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 44545
    
  34
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
 
It's not a secret anymore!