This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Anonymous Classes doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Anonymous Classes doubt" Watch "Anonymous Classes doubt" New topic
Author

Anonymous Classes doubt

Deepak Borania
Ranch Hand

Joined: Jul 28, 2009
Posts: 45
Can someone please elaborate on Anonymous classes and tell me what they are used for.I am using Horton's Beginning Java, which isn't clear on the subject.

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41076
    
  43
Maybe the "Nested Classes" chapter in the Sun Java tutorial does a better job: http://java.sun.com/docs/books/tutorial/java/javaOO/index.html


Ping & DNS - my free Android networking tools app
Deepak Borania
Ranch Hand

Joined: Jul 28, 2009
Posts: 45
It just has one line on Anonymous classes, in which it says it's for advanced users.

Can someone please help me understand Anonymous Classes?
Nitish Bangera
Ranch Hand

Joined: Jul 15, 2009
Posts: 537

I guess if you reached annonymous classes then you may be knowing annonymous arrays. Its the same Like array we are creating a new array without a name. In annonymous classes we are creating classes without a name but not just any class but the a subclass which has no name. Annonymous classes can be used to subclass an abstract class and also implement an interface directly. Well all other concepts are same as subclasses as annonymous classes.


[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
Explanations might be confusing, just visit this tutorial


Experience and talent are independent of age
Deepak Borania
Ranch Hand

Joined: Jul 28, 2009
Posts: 45
hmm.....starting to get the hang of it....thanks guys

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anonymous Classes doubt
 
Similar Threads
Topic for JavaRanch Journal Article / SCJP Tipline
when we need inner classes
interface implementation and inner classes
Anonymous Classes & Exception Handling
inner class