Tagging Interfaces in Java

前端 未结 8 2085
时光说笑
时光说笑 2021-01-02 06:26

What are tagging interfaces and what are they used for?

8条回答
  •  时光说笑
    2021-01-02 06:51

    A tagging interface typically has some magic associated with it: either directly built into the VM, or using reflection. Because the magic could technically apply to any class, you use the tagging to indicate that you thought well about the magic and whether it applies to your class.

提交回复
热议问题