Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

anonymous class, please help

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here comes the Javaranch Cop...
"mpisi", PROPER NAMES ARE NOW REQUIRED!!
Read this post for more details.
Ajith
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
mpisi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
How do they get the deer to cross at the signs? Or to read this tiny ad?
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic