说你想,而无需创建一个变量,或者串行或参考的东西(@see)返回的版本,你可以做类似的东西: public @Version getVersion() {
return /*the @Version tag on this class*/;
}
凡@版本是一个运行时可见在类或方法上声明的注解(以及对于Java 8,Type Annotations)?
支持目前我研究上Java8的新功能:http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html 从上面的链接,它清楚地表明: Type Annotations provide the ability to apply an annotation anywhere a type is used, not just on