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.
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: 536
posted
0
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
posted
0
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
posted
0
hmm.....starting to get the hang of it....thanks guys