Forums Register Login

anonymous class, please help

+Pie Number of slices to send: Send
hello there
i have come across the name "anonymous class".i realy don't understand what kind of class it is ,can some one explain and give me an example.
thanks
desmond mongwe
------------------
mpisi@mailbox.co.za
+Pie Number of slices to send: Send
Here comes the Javaranch Cop...
"mpisi", PROPER NAMES ARE NOW REQUIRED!!
Read this post for more details.
Ajith
+Pie Number of slices to send: Send
Anonymous classes, as the name suggests, are classes which are declared and defined at the point of usage in the program. If you need to 'cook' a class, but would like to use it only once, and if it has very few( usually one or two ) methods in it, then it is probably a good candidate for an anonymous class.
You can read and learn more about them in any good Java book. I would suggest you to pickup a good JavaBook( Thinking In Java by Bruce Eckel is free and popular. The RHE certification guide is another excellent book.
Good luck,
Ajith
+Pie Number of slices to send: Send

hi Ajith Kallambella

thanks for your respond , i understand the concept now,i just have to put it into practice.
message by
desmond


------------------
mpisi@mailbox.co.za
+Pie Number of slices to send: Send
to javaranch cop
i apologise for that name ,i have now changed my user name from mpisi to desmond mongwe
message by
desmond
------------------
mpisi@mailbox.co.za
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 563 times.
Similar Threads
Inner class question from Dan's exam
anonymous class
Dont miss this tutorial !!
Passing an object to a method.
Anonymous class ???
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:00:45.