import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Created by BaiJiFeiLong@gmail.com at 2018/4/17 11:15
*/
@App.Rubbish(name = "APP")
public class App {
@Retention(RetentionPolicy.RUNTIME)
@interface Rubbish {
String name();
}
public static void main(String[] args) {
annotation();
}
private static void annotation() {
String name = App.class.getAnnotation(Rubbish.class).name();
System.out.println("Rubbish name: " + name);
}
}