/*
 * Created on 2004-8-11
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package workflow.test;

/**
 * @author reic
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class CloneTest
{

	public static void main(String[] args) throws Exception
	{
		Test prototype=new Test();
		prototype.print();
		
		Test t1=(Test)prototype.clone();
		t1.name="t1";	
		System.err.println("t1.name="+t1.name);
		t1.print();
		
		Test t2=(Test)prototype.clone();
		t2.name="t2";	
		System.err.println("t1.name="+t1.name);
		System.err.println("t2.name="+t2.name);
		
		Test tx=(Test)prototype.clone();
		System.err.println("tx.name="+tx.name);
	}
}

class Test implements Cloneable
{
	public String name="zosatapo";
	public TestC tc;
	
	public Test()
	{
		tc=new TestC(this);
	}
	public Object clone() throws CloneNotSupportedException
	{
		return super.clone();
	}
	
	public void print()
	{
		tc.print();
	}
}

class TestC
{
	Test t;
	public TestC(Test t)
	{
	this.t=t;
	}
	
	public void  print()
	{
		System.err.println(t);
	}
}
