Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inner classes

 
Abdul Latif
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we make an instance of an inner class outside the class in which we have the inner class.
please explain in details
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not giving it a try before?
Anyway...
 
Ragu Sivaraman
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jose Botella:
[B]Why not giving it a try before?
Anyway...
[/B]


Also, if Test extends containing
we can call class Inner() directly from an instance method in Test without new Containing() construct, (coz Test inherits all the members from containing

Ragu
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similarly we could use new Nested() within a static method of the subclass.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic