This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How deep Innerclasses could be!

 
Brian Smith
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
is there any limitation in layer of innerclass we could make inside a class?
thanks.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really. It's possible there's some fundamental limitation based on memory limitations or class file formats, similar to the way a String can never have more than Integer.MAX_VALUE chars in it. But practically speaking, you can nest as deep as you want. The limiting factor will probably be that someone may shoot you for writing unreadable code if your nesting gets too deep.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic