Source Home >> Java Source 1.6.0 >> java.lang.Cloneable V 0.09
  • 01/*
  • 02 * @(#)Cloneable.java 1.17 05/11/17
  • 03 *
  • 04 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  • 05 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  • 06 */
  • 07
  • 08package java.lang;
  • 09
  • 10/**
  • 11 * A class implements the <code>Cloneable</code> interface to
  • 12 * indicate to the {@link java.lang.Object#clone()} method that it
  • 13 * is legal for that method to make a
  • 14 * field-for-field copy of instances of that class.
  • 15 * <p>
  • 16 * Invoking Object's clone method on an instance that does not implement the
  • 17 * <code>Cloneable</code> interface results in the exception
  • 18 * <code>CloneNotSupportedException</code> being thrown.
  • 19 * <p>
  • 20 * By convention, classes that implement this interface should override
  • 21 * <tt>Object.clone</tt> (which is protected) with a public method.
  • 22 * See {@link java.lang.Object#clone()} for details on overriding this
  • 23 * method.
  • 24 * <p>
  • 25 * Note that this interface does <i>not</i> contain the <tt>clone</tt> method.
  • 26 * Therefore, it is not possible to clone an object merely by virtue of the
  • 27 * fact that it implements this interface. Even if the clone method is invoked
  • 28 * reflectively, there is no guarantee that it will succeed.
  • 29 *
  • 30 * @author unascribed
  • 31 * @version 1.17, 11/17/05
  • 32 * @see java.lang.CloneNotSupportedException
  • 33 * @see java.lang.Object#clone()
  • 34 * @since JDK1.0
  • 35 */
  • 36public interface Cloneable {
  • 37}

文件:Cloneable.java
包名:java.lang
类名:Cloneable
继承:
接口: