• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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)
 
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic