gpt4 book ai didi

java - 变量定义中关键字的顺序重要吗?

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:44:04 24 4
gpt4 key购买 nike

顺序有没有区别:

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com