扫码关注官方订阅号
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
成员xx对应的是类xx。比如成员变量和类变量,即在一个类中非static修饰和static修饰的。
常量可以分成成员常量和类常量,看有没有static修饰罢了
java语言规范中有final Variables的定义,在实例中只用final修饰的变量应该就叫做final变量。
final
final变量
static和final同时修饰才称为常量。java规范定义如下
static
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"
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
成员xx对应的是类xx。比如成员变量和类变量,即在一个类中非static修饰和static修饰的。
常量可以分成成员常量和类常量,看有没有static修饰罢了
java语言规范中有final Variables的定义,在实例中只用
final
修饰的变量应该就叫做final变量
。static
和final
同时修饰才称为常量。java规范定义如下