zoukankan      html  css  js  c++  java
  • java.lang.Cloneable

    /**
     * 实现 <code>Cloneable</code>接口也即表明{@link java.lang.Object#clone()}方式是合法的.
     * 也即实现一个字段到字段的复制.
     * <p>
     * 如果clone的对象没有实现<code>Cloneable</code>将抛出<code>CloneNotSupportedException</code>
     * <p>
     * 依据惯例来说,实现此接口的类应该重写 <tt>Object.clone</tt>(protected)成pubic.
     * 更多查看 {@link java.lang.Object#clone()}
     * 注意,此接口未包含<tt>clone</tt>方法.仅仅只实现了这个接口也无法保证clone会成功,
     * 即使是通过反射来调用.
     * 
     */
    /**
     * A class implements the <code>Cloneable</code> interface to
     * indicate to the {@link 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 {
    }
  • 相关阅读:
    512M内存机器如何用好Mysql
    linux下查找文件和文件内容
    记“debug alipay”一事
    OFBiz中根据店铺获取产品可用库存的方法
    ubuntu中安装eclipse
    ubuntu中安装jdk
    ubuntu14.04中解压缩window中的zip文件,文件名乱码的解决方法
    apache将请求转发到到tomcat应用
    网站不能访问的原因
    birt报表图标中文显示为框框的解决方法
  • 原文地址:https://www.cnblogs.com/shuiyonglewodezzzzz/p/11128066.html
Copyright © 2011-2022 走看看