FileDocCategorySizeDatePackage
DeepSheep.javaAPI DocExample476Tue Jul 08 02:42:34 BST 1997None

DeepSheep.java

import java.util.Hashtable;

public class DeepSheep implements Cloneable {
	Hashtable flock = new Hashtable();

	public Object clone() {
		try {
			DeepSheep copy = (DeepSheep)super.clone();
			copy.flock = (Hashtable)flock.clone();
			return copy;
		} catch (CloneNotSupportedException e ) { 
			throw new Error("This should never happen!");
		}
	}

	public void main(String [] args) {
		DeepSheep one = new DeepSheep();
		DeepSheep anotherOne = (DeepSheep)one.clone();
	}
}