What's the difference between interface and @interface in java?

后端 未结 5 735
甜味超标
甜味超标 2020-12-02 03:44

I haven\'t touched Java since using JBuilder in the late 90\'s while at University, so I\'m a little out of touch - at any rate I\'ve been working on a small Java project th

5条回答
  •  独厮守ぢ
    2020-12-02 04:11

    The interface keyword indicates that you are declaring a traditional interface class in Java.
    The @interface keyword is used to declare a new annotation type.

    See docs.oracle tutorial on annotations for a description of the syntax.
    See the JLS if you really want to get into the details of what @interface means.

提交回复
热议问题