Java examples for Language Basics:try with Resources
implements Cloneable interface
class Clone implements Cloneable { int a;// w w w . jav a 2 s . co m Clone(int a) { this.a = a; } public static void main(String[] args) throws CloneNotSupportedException { Clone c = (Clone) new Clone(10).clone(); System.out.println(c.a); } }