The order of Java method modifiers is fixed.
Annotation public protected private
abstract static final synchronized native strictfp
It seems that it is customary to write in the order of.
○ public static final
× public final static
○ public abstract
× abstract public
It was written in the Java language specification. You even mention the coding style in the language specifications. I was surprised.
If two or more (distinct) method modifiers appear in a method declaration, it is customary, though not required, that they appear in the order consistent with that shown above in the production for MethodModifier.
The Java® Language Specification - Java SE 12 Edition https://docs.oracle.com/javase/specs/jls/se12/html/jls-8.html#jls-8.4.3
Recommended Posts