for the code below i'm getting following runtime error error
package project;
class B {
int a;
B d = new B();
}
class C {
public static void main(
String args[])
{
C c = new C();
B b = new B();
System.out.println(b.d.a);
}
}
can anybody explain why???
--------------------------------------------------
compile:
run:
Exception in
thread "main" java.lang.StackOverflowError
at project.B.<init>(C.java:6)
[.. removed 200+ repeated lines]
at project.B.<init>(C.java:6)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
[ October 19, 2007: Message edited by: Eric Pascarello ]