define the two classes like: ====================== public class B { private A a = new A(); public static void main(String[] args){ new B(); } } public class A { private B b = new B(); } ===================== its will throw init exception ,could it be reconized automaticlly