java.lang
public class CloneNotSupportedException extends Exception
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(); }
Cloneable
,
Object.clone()
,
Serialized FormConstructor and Description |
---|
CloneNotSupportedException()
Create an exception without a message.
|
CloneNotSupportedException(String s)
Create an exception with a message.
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public CloneNotSupportedException()
public CloneNotSupportedException(String s)
s
- the error message