Error
The member annotation can only be defined inside a top-level class or interface or in a static context while using annotation types.
Error Type
Compile Time
Sample Code
public class BuggyBread {
public static void main(String[] args) {
public @interface Buggy {
}
}
}
Cause
The specified annotation is class member level and not method level.
Resolution
public class BuggyBread {
public @interface Buggy {}
public static void main(String[] args) {}
}