The Java Language Specification recommends listing modifiers in the following order:
- Annotations
- public
- protected
- private
- abstract
- static
- final
- transient
- volatile
- synchronized
- native
- default
- strictfp
Not following this convention has no technical impact, but will reduce the code’s readability because most developers are used to the standard
order.
Noncompliant code example
static public void main(String[] args) { // Noncompliant
}
Compliant solution
public static void main(String[] args) { // Compliant
}