I came across this questions on one of the online Java Tests. The options were 4,5,8 and any number of times.
I have only used one inner class, but have never tried
The true answer is none of the above. Javac will of course allow arbitrary nesting, but the underlying file system and/or OS have restrictions. We found recently that during startup the JVM running a Glassfish Java EE application server instance will hold open files to each .class during loading/JIT compilation. If you're running CentOS Linux say, the default limit on open files/process is 1024, so if you have a lot of classes being loaded at once and don't set the ulimit -n to a higher value, the JVM will hit "too many open files". And @Mark Byers' example shows that the .class file names get very long and can hit the file system name length limit, if there is one.