开发者

Confusion in marker interface

开发者 https://www.devze.com 2022-12-20 20:17 出处:网络
Marker interface means interface which have no methods. Then why we call the Runnable interface as开发者_开发百科 a marker interface, even though it has run() method.

Marker interface means interface which have no methods. Then why we call the Runnable interface as开发者_开发百科 a marker interface, even though it has run() method. And one more thing how many marker interfaces are there in java ?


Then why we call the Runnable interface as a marker interface

We don't. You just made that up.


Runnable is not a Marker interface. AFAIK, Serializable, Clonable, SingleThreadModel, EventListener, RandomAccess, Remote are Marker Interfaces.

0

精彩评论

暂无评论...
验证码 换一张
取 消