// @retention indicates the extent of annotation Retention. SOURCE= annotations will be discarded by the compiler when compiled and will not exist at runtime. @retention (retentionPolicy.source) // @target where the annotation needs to be used PARAMETER= annotations will be used in the method's parameters @target ({elementtype.parameter}) // Explicitly declare the defined integer value, @intdef, @longdef, @stringdef and so on @intdef (value = {MyAnnotation.CONST_V1, MyAnnotation.CONST_V2}) public @interface MyAnnotation { int CONST_V1 = 0x00; int CONST_V2 = 0x01; }Copy the code