The order of access modifiers does not matter. They just have to be present.
For method modifiers, the Java language specification states that this is normal, although it is not required that they be displayed in the order shown above in the MethodModifier method, which:
(Annotation) public protected private abstract static final synchronized native strictfp
Adding
Recommended order of field modifiers (from JLS 8.3.1 ):
(Annotation) public protected private static final transient volatile
Recommended order of class modifiers (from JLS 8.1.1 ):
(Annotation) public protected private abstract static final strictfp
(Annotation) is not a modifier; it is a placeholder for any annotation. Annotations must be placed before any other modifier.
source share