Does the order of keywords in the definition of variables mean?

Is there a difference between the order:

public static final String = "something"; 

or

 public final static String = "something"; 

?

+6
source share
3 answers

No, although the Java Language Specification recommends using the first order:

 FieldModifiers: FieldModifier FieldModifiers FieldModifier FieldModifier: one of Annotation public protected private static final transient volatile 

... If two or more (separate) field modifiers appear in the declaration field, this is accepted, although it is not required that they appear in the order corresponding to the one described above in the production for FieldModifier.

+11
source

No - there is no difference between the two.

From section 8.3.1 Java 2 Language Specifications:

"If two or more (separate) field modifiers appear in the declaration field, this is accepted, although it is not required that they appear in the order corresponding to the above production for FieldModifier."

+7
source

Not. Choose one and follow this naming consecutively

0
source

Source: https://habr.com/ru/post/885435/


All Articles