博客主机
A-A+

Marker Interfaces

2008年10月19日 Java 暂无评论

Marker interfaces are that which don't declare any method or atrributes. It is used to mark classes conceptually. By using marker interfaces, a developer can tag certain code without complicating its inheritance structure. For example, Serializable is a marker interface that you see all over the place. This interface marks a class as having the ability to be flattened and serialized to a stream and then restored from that stream. This allow Java to store objects in files and the virtual machine know that this class can be introspected and then written out. Classes that are not serializable do not have this ability.

标签:

给我留言

Copyright © 小小的数据技术梦想 保留所有权利.   Theme  Ality 浙ICP备12043346号-1

用户登录

分享到: