• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nested class

 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Silly but please bear with me... just read "top-level nested class" can be marked staitc. Which one is TOP LEVEL NESTED CLASS here?


outer or inner1? And do the terms
"nested class" and "inner class" mean same??
[ October 05, 2005: Message edited by: Akhil Trivedi ]
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If am not wrong...

outer is top level class...

inner1 is top-level nested class

 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
inner1 is top-level nested class, if marked static. In the example portrayed by you, it is a regular inner class.

Refer below:

 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right,
Actually when the inner classes are marked static, they no longer remain inner classes, infact they can be treated just like a top level class, but since they are inside another class, they are also nested class.
so a static inner class is called Top Level Nested class.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the correction..!!!

 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kumar, Sravan and sandeep thank you all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic