I have this confusion abt cloning
//CloneTest.java
public class CloneTest{
public Object clone(){
//super.clone(); 1
return new CloneTest();
}
public static void main(
String[] args){
CloneTest aClone=new CloneTest();
CloneTest bClone=(CloneTest) aClone.clone();
}
}
This compiles pefectly fine and i dont get CloneNotSupportedException?
But uncommenting super.clone() causes compilation error.CloneNot...
not caught.Does this mean if and only if you use Object.clone() in your clone implementaion you have to use the Clonenable interface?
Can someone explain the use of this (tagging?) interface,as there are no methods in this interface.
Thx in Advance.