36 |
*/ |
*/ |
37 |
|
|
38 |
/** |
/** |
39 |
* Exceptions may be thrown by one part of a Java program and caught |
* Thrown to indicate an object should not or could not be cloned. This |
40 |
* by another in order to deal with exceptional conditions. |
* includes the case when {@link Object#clone()} is called on an object |
41 |
* Thrown to indicate an object should not or could not be cloned. |
* which does not implement the {@link Cloneable} interface. |
42 |
* For example <code>CloneNotSupportedException</code> is thrown by |
* <p> |
43 |
* the <code>clone</code> method of <code>Object</code> to indicate |
* |
44 |
* that object does not implement the <code>Cloneable</code> interface. |
* Notice that calling <code>clone()</code> on an array will never produce |
45 |
|
* this exception, as the VM will always succeed in copying the array, or |
46 |
|
* cause an OutOfMemoryError first. |
47 |
* |
* |
|
* @since JDK 1.0 |
|
|
* |
|
48 |
* @author Brian Jones |
* @author Brian Jones |
49 |
* @author Warren Levy <warrenl@cygnus.com> |
* @author Warren Levy <warrenl@cygnus.com> |
50 |
* @date September 18, 1998. |
* @author Eric Blake <ebb9@email.byu.edu> |
51 |
|
* @since 1.0 |
52 |
|
* @see Cloneable |
53 |
|
* @see Object#clone() |
54 |
*/ |
*/ |
55 |
public class CloneNotSupportedException extends Exception |
public class CloneNotSupportedException extends Exception |
56 |
{ |
{ |
57 |
static final long serialVersionUID = 5195511250079656443L; |
/** |
58 |
|
* compatible with JDK 1.0+ |
59 |
|
*/ |
60 |
|
private static final long serialVersionUID = 5195511250079656443L; |
61 |
|
|
62 |
/** |
/** |
63 |
* Create an exception without a message. |
* Create an exception without a message. |
64 |
*/ |
*/ |
65 |
public CloneNotSupportedException() |
public CloneNotSupportedException() |
66 |
{ |
{ |
67 |
super(); |
} |
|
} |
|
68 |
|
|
69 |
/** |
/** |
70 |
* Create an exception with a message. |
* Create an exception with a message. |
71 |
|
* @param s the error message |
72 |
*/ |
*/ |
73 |
public CloneNotSupportedException(String s) |
public CloneNotSupportedException(String s) |
74 |
{ |
{ |
75 |
super(s); |
super(s); |
76 |
} |
} |
77 |
} |
} |