• Post Reply Bookmark Topic Watch Topic
  • New Topic

nested class - is it True?  RSS feed

 
majohnad majohnad
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
the following sentence is true?
"An instance of a top level nested class can be created without an instance of its enclosing class"
Thanks in Advance
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically there's no such thing as a "top-level nested class" anymore because Sun got rid of this ugly terminology in the second edition of the JLS (almost three years ago). A class is either top-level or nested, never both. However the type of class that used to be called "top-level nested" (ugh) is now known as a static member class. The following statement is true:
An instance of a static member class can be created without an instance of its enclosing class.
Now, what you probably need to do is read up about static member classes, or top-level nested classes, or whatever else they're called in the book you use, and try to compile and run some code that uses them. E.g.
 
kishor rao
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the statements true. a nested class object will have to br created explicitly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!