public class A { public static void main(String[] args) { B c1 = new B(5); System.out.println("c1: "+c1); B c2 = (B)c1.clone(); System.out.println("c2: "+c2); } } class B implements Cloneable { double radius; public B(double radius) { this.radius=radius; } public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException ex) { return null; } } public String toString() { return "radius "+radius; } }