• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anonymous Classes doubt

 
Deepak Borania
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Deepak Borania
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 537
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Explanations might be confusing, just visit this tutorial
 
Deepak Borania
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm.....starting to get the hang of it....thanks guys

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic