FileDocCategorySizeDatePackage
Clone1.javaAPI DocExample706Sat Feb 17 13:42:14 GMT 2001None

Clone1

public class Clone1 extends Object implements Cloneable

Fields Summary
int
x
transient int
y
Constructors Summary
Methods Summary
public java.lang.Objectclone()
Clone this object. Just call super.clone() to do the work

		return super.clone();
	
public static voidmain(java.lang.String[] args)

 
		Clone1 c = new Clone1();
		c.x = 100;
		c.y = 200;
		try {
			Object d = c.clone();
			System.out.println("c=" + c);
			System.out.println("d=" + d);
		} catch (CloneNotSupportedException ex) {
			System.out.println("Now that's a surprise!!");
			System.out.println(ex);
		}
	
public java.lang.StringtoString()
Display the current object as a string

		return "Clone1[" + x + "," + y + "]";