If a Marker Interface does not have any methods, how does it work?

后端 未结 5 1936
长情又很酷
长情又很酷 2020-11-27 21:08

I am aware of what marker interface is and when we need to use it. One question is still not clear to me. If a marker interface does not have any method or body, how does

5条回答
  •  再見小時候
    2020-11-27 21:30

    A marker interface tells JVM that the class being marked by marker interface to add functionality of a marker interface . Like implementing Cloneable tells JVM that this class implements Cloneable and hence JVM will have to copy it bit-wise.

提交回复
热议问题