File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes How deep Innerclasses could be! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How deep Innerclasses could be!" Watch "How deep Innerclasses could be!" New topic

How deep Innerclasses could be!

Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
hi all,
is there any limitation in layer of innerclass we could make inside a class?
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
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.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: How deep Innerclasses could be!
It's not a secret anymore!