public class Kloon2Test{ public static void main(String[] argumendid){ Kloon2 k1=new Kloon2(); k1.nimi="Maasu"; k1.isa=new Kloon2(); k1.isa.nimi="Punik"; k1.ema=new Kloon2(); k1.ema.nimi="Maara"; k1.isa.isa=new Kloon2(); k1.isa.isa.nimi="Puhvel"; System.out.println(k1); Kloon2 k2=(Kloon2)k1.clone(); k2.isa.isa.nimi="Puhvik"; System.out.println(k1); System.out.println(k2); } } /* D:\kodu\0312>java Kloon2Test Maasu(Punik(Puhvel(, ), ), Maara(, )) Maasu(Punik(Puhvel(, ), ), Maara(, )) Maasu(Punik(Puhvik(, ), ), Maara(, )) */