java.lang
Class CloneNotSupportedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.CloneNotSupportedException

public class CloneNotSupportedException
extends Exception

Thrown to indicate an object should not or could not be cloned. This includes the case when Object.clone() is called on an object which does not implement the Cloneable interface. For example:

 void m() throws CloneNotSupportedException
 {
   clone();
 }
 

Notice that calling clone() on an array will never produce this exception, as the VM will always succeed in copying the array, or cause an OutOfMemoryError first. For example:

 void m(int[] array)
 {
   int[] copy = (int[]) array.clone();
 }
 

See Also:
Cloneable, Object.clone()

Constructor Summary
CloneNotSupportedException()
          Create an exception without a message.
CloneNotSupportedException(String s)
          Create an exception with a message.
 
Method Summary
 
Methods inherited from class java.lang.Throwable
getCause, getLocalizedMessage, getMessage, initCause, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CloneNotSupportedException

public CloneNotSupportedException()
Create an exception without a message.


CloneNotSupportedException

public CloneNotSupportedException(String s)
Create an exception with a message.

Parameters:
s - the error message