顺序有没有区别:
public static final String = "something";
或
public final static String = "something";
?
最佳答案
不,虽然 Java Language Specification建议您使用第一个排序:
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.
关于java - 变量定义中关键字的顺序重要吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5584238/