The following code did not throw any exception for me and the output was 2 and null.
I compiled with jdk1.4
class Class2
{
int i;
public Class2(int i) { this.i = i; }
public String toString()
{
if(i == 0) return null;
else return ""+i;
}
public static void main(String[ ] args)
{
Class2 t1 = new Class2(0);
Class2 t2 = new Class2(2);
System.out.println(t2);
System.out.println(""+t1);
}
}
Any thoughts?
