java.lang.Cloneable

/ * * 
 * Achieve <code> Cloneable </ code> indicates that the interface i.e. {@link java.lang.Object # clone ()} is a legitimate manner. 
 * I.e. to achieve a copy of the field to field. 
 * <P> 
 * If the clone of the object does not implement <code> Cloneable </ code> will throw <code> CloneNotSupportedException </ code> 
 * <the p-> 
 * By convention, the class that implements the interface should override <tt> Object.clone </ tt> (protected) to the pubic. 
 * more See # java.lang.Object clone @link {()} 
 * Note that this interface does not contain <tt> clone </ tt> methods only just implements this interface there is no guarantee clone will succeed, 
 * even invoked through reflection. 
 * 
 * / 
/ * * 
 * A class the implements at The <code> the Cloneable </ code> interface to 
 * Indicate at The {@link to the java.lang.Object#clone()} method that it
 * is legal for that method to make a
 * field-for-field copy of instances of that class.
 * <p>
 * Invoking Object's clone method on an instance that does not implement the
 * <code>Cloneable</code> interface results in the exception
 * <code>CloneNotSupportedException</code> being thrown.
 * <p>
 * By convention, classes that implement this interface should override
 * <tt>Object.clone</tt> (which is protected) with a public method.
 * See {@link java.lang.Object#clone()} for details on overriding this
 * method.
 * <p>
 * Note that this interface does <i>not</i> contain the <tt>clone</tt> method.
 * Therefore, it is not possible to clone an object merely by virtue of the
 * fact that it implements this interface.  Even if the clone method is invoked
 * reflectively, there is no guarantee that it will succeed.
 *
 * @author  unascribed
 * @see     java.lang.CloneNotSupportedException
 * @see     java.lang.Object#clone()
 * @since   JDK1.0
 */
public interface Cloneable {
}

 

Guess you like

Origin www.cnblogs.com/shuiyonglewodezzzzz/p/11128066.html