• 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

anonymous classes

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a doubt:
Is an anonymous class a member class ?
Can anyone please explain me.
Thanks,
Gayatri.
 
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gayatri,
The declaration of a member class is directly enclosed within the declaration of an interface or within another class. The term "directly" means that a member class declaration is not nested within something else that is enclosed by the enclosing class. An annonymous class declaration is really a class instance creation expression that ends with an optional class body. In other words, an annonymous class declaration is an expression and that expression must appear within a statement and the statement could appear within a method, constructor, etc. For those reasons, it would be difficult to argue that an anonymous class should be considered a member class.
 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dan.
 
A "dutch baby" is not a baby. But this tiny ad is baby sized:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic