What is common is the use of use static finals to implement "constant" values, an approach that goes against the object-oriented concept of information hiding.
常见的是使用use static finals来实现“常数”值,这是一种与信息隐藏的面向对象概念背道而驰的方法。
Atoms are static (or constant) literals.
原子值是静态的(即不变的)字面值。
Embedded statements are not allowed in constant expressions, such as the value of an enumeration constant, the width of a bit-field, or the initial value of a static variable.
在常量表达式,比如枚举型常量、位域的宽度或是静态变量的初始值,是不允许使用在这种声明中的。
应用推荐