The problem with your code is that the Anonymous default constructor gets called somewhat "recursively". When you are calling the Anonymous constructor inside main() (i.e. new Anonymous()), the component objects get initialized first. That is, the constructor gets called again, because the an objects [of type Anonymous as well] needs to be assigned its value before the constructor finishes. There you go - an infinite constructor call chain - eventually ending in a StackOverflowException. I used the IBM JDK as well, and it refused to load my class - perhaps this compiler is a little "smarter" than the SUN javac