本文介绍了什么是Java中使用的标志接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当没有什么像序列化的标记接口来实现。 。有什么用实施呢?
When there is nothing to implement in the marker interfaces like Serializable . . what is the use of implementing it?
推荐答案
在早期版本的Java,,这允许非常灵活的可完全取代元数据功能。如果您对一个类的信息,而这些信息不会改变,那么注解是重新present这是一个非常有用的方式。
In modern Java, marker interfaces have no place. They can be completely replaced by Annotations, which allow for a very flexible metadata capability. If you have information about a class, and that information never changes, then annotations are a very useful way to represent it.
这篇关于什么是Java中使用的标志接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!