RetentionPolicy.CLASS means that the annotation is stored in the .class file, perhaps not available at runtime. This is the default retention policy;any retention policy is not specified at all. RetentionPolicy.SOURCE means that the annotation is only available in the source code and not in the .class files and not a runtime. While creating own annotations for use with build tools that scan the code, this retention policy can be used. That way the .class files are not polluted unnecessarily.
Here is an example for this type of annotation.
Code Snippet 23: