@Test public void testClone() { Clone1 d = (Clone1)c.clone(); System.out.println("c=" + c); System.out.println("d=" + d); assertEquals(c.x, d.x); assertEquals(c.y, d.y); }
public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException ex) { System.out.println("Now that's a surprise!!"); throw new InternalError(ex.toString()); } }
Clone1 implements Cloneable { public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException ex) { System.out.println("Now that's a surprise!!"); throw new InternalError(ex.toString()); } } }
Clone1 implements Cloneable { public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException ex) { System.out.println("Now that's a surprise!!"); throw new InternalError(ex.toString()); } }  }
Clone1 implements Cloneable { public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException ex) { System.out.println("Now that's a surprise!!"); throw new InternalError(ex.toString()); } }  Object clone(); String toString(); }
Clone1 implements Cloneable { public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException ex) { System.out.println("Now that's a surprise!!"); throw new InternalError(ex.toString()); } }  Object clone(); String toString();  }