• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Anonymous class

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody explain, why we can't use keywords implement and extend with it.
thanks
Shikhar
 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because ,As you may remember, Anonymous class doesn't have a name. So if you want to implement or extend the class, u must mention the class name.
I think this is the reason.

If this is not, please correct me.

sdev.

Originally posted by shikhar:
Can anybody explain, why we can't use keywords implement and extend with it.
thanks
Shikhar


 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To add to what Sdev said,
Anonymous classes are designed for brevity. They are ( and should be ) used where a class is declared and used within a very limited scope, and the class typically contains very few entities. So, perhaps the designers of the language decided not to support full class declaration syntax for anonymous classes.
Makes sense??
Ajith
[This message has been edited by Ajith Kallambella (edited July 13, 2000).]
 
No holds barred. And no bars holed. Except this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic