class Foo
{
Foo()
{
this("bar");
}
Foo(String s)
{
this();
}
}
public class TestFoo
{
public static void main()
{
Foo f=new Foo();
}
}
Hmm i was really eager to get a C'tor loop going to get the stack to overflow, after reading about Contructors in the java cert book by KS and BB . But the Compiler caught a recursive C'tor call at compile time. So i never got to the point where an ambiguous runtime call to Object's super() would cause a stack overflow. Smart Compiler
Saturday, June 03, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment