FileDocCategorySizeDatePackage
ConsRecurs.javaAPI DocExample450Sat Oct 26 09:53:48 BST 2002None

ConsRecurs

public class ConsRecurs extends Object
What happens when two constructors call each other? Can you get an infinite loop out of the process?

Fields Summary
Constructors Summary
public ConsRecurs(int i)

		this(i*1.0);	// EXPECT COMPILE ERROR
	
public ConsRecurs(double d)

		this((int)d);	// EXPECT COMPILE ERROR
	
Methods Summary
public static voidmain(java.lang.String[] a)

		System.out.println("About to construct...");
		new ConsRecurs(Math.PI);
		System.out.println("Hey, I'm still alive!");