Annotations on Interfaces?

前端 未结 10 2159
一生所求
一生所求 2020-12-08 21:52

I can\'t figure out a use case for being able to annotate interfaces in Java.

Maybe someone could give me an example?

10条回答
  •  轮回少年
    2020-12-08 22:35

    I've seen a lot of research tools use method annotations to allow users to specify protocols, restrictions, etc. to facilitate automatic checking later.

    Since annotations don't dictate what you can do with them, there is no good reason not to allow users to annotate interfaces.

提交回复
热议问题