• 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 inner classes

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anonymous inner classes cannot have any extends or implements clause.
is this statement true or false.please explain in detail
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hi
anonymous inner classes cannot have any extends or implements clause.
The statment is false, they can have extend or implement clause.
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if an anonymous class is declared using the name of an interface as follows:
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
...
}
}
it is said to be implementing that interface(ActionListener here)
if an anonymous class is declared using the name of a class as follows:
new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
...
}
}
it is said to be extending that class(WindowAdapter here)
the "clause" extends or implements is NEVER used.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sweekriti is right.
So we cannot specify any extends or implements clause.
 
preeti dengri
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so the anonymous inner classes can extend a class or implement an interface only IMPLICITLY ---this is what i infer
Am i right??
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi you can find documents about inner classes from
http://www.geocities.com/korayguclu/

------------------
------------------------
Koray G��l�
(B.s. Computer Engineer)
 
reply
    Bookmark Topic Watch Topic
  • New Topic