There is a definition of final Variables in the Java language specification, and only final修饰的变量应该就叫做final变量 is used in examples.
static和finalIt is called a constant if it is modified at the same time. The Java specification is defined as follows
static variables that are final and that are initialized with compile-time constant values are initialized first. This also applies to such fields in interfaces (§9.3.1). These variables are "constants"
Member xx corresponds to class xx. For example, member variables and class variables are non-statically modified and statically modified in a class.
Constants can be divided into member constants and class constants, just check whether there is static modification
There is a definition of final Variables in the Java language specification, and only
final
修饰的变量应该就叫做final变量
is used in examples.static
和final
It is called a constant if it is modified at the same time.The Java specification is defined as follows