Is there any difference between the order:
public static final String = "something";
or
public final static String = "something";
?
No, although the Java Language Specification recommends that you use the first ordering:
FieldModifiers: FieldModifier FieldModifiers FieldModifier FieldModifier: one of Annotation public protected private static final transient volatile
... If two or more (distinct) field modifiers appear in a field declaration, it is customary, though not required, that they appear in the order consistent with that shown above in the production for FieldModifier.
No - there is no difference betweeen the two.
From section 8.3.1 of the Java 2 Language Specification:
"If two or more (distinct) field modifiers appear in a field declaration, it is customary, though not required, that they appear in the order consistent with that shown above in the production for FieldModifier."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With