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.
java.lang.CloneNotSupportedException is called a 'compile-time checked exception'. There is a fierce debate (which seems to have concluded) about the validity of compile-time checked exceptions (i.e. it is agreed that they are a design flaw, otherwise, you don't have all the facts). Nonetheless, you have to put up with them in a Java context, since they are intrinsic to the language, and a great deal of the core API.
When you call a method that declares to throw a checked exception, it must be declared to be caught (with a try/catch block) or thrown (with the throws keyword).