在看core java,当中有一段话如下
The Cloneable interface is one of a handful of tagging interfaces that Java provides
A tagging interface has no methods; its only purpose is to allow the use of
instanceof in a type inquiry:
if (obj instanceof Cloneable) . . .We recommend that you do not use tagging interfaces in your own programs为什么书上说不推荐使用 tagging interfaces 呢

解决方案 »

  1.   

    Cloneable只是标记型的interface,并不提供真正的业务方法,类似的还有Seriable等等,一般都是系统级的!自己的程序不需要!
      

  2.   

    Cloneable的实现恐怕不止是简单的语法实现,可能有编译器参与其中,按书上的说法,我们自己实现的tag interface得不到编译器的支持,所以不推荐。但我个人理解在有需要时使用tag interface是没有问题的.