Cloneable
Cloneable是一个空接口,他里面什么也没有,那么为什么要定义这么一个接口呢?首先我们来看源码中的解释:
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.
一个类实现了Cloneable接口就表明clone()这个方法对于这个类能够使文件与文件之间实例的复制是合法的。
浙公网安备 33010602011771号