java如何替换字符串中某个字符的数字(Java Tips How do I declare a constant in Java)
导读:How do I declare a constant in Java User Rating:/140...
How do I declare a constant in Java
User Rating:/140
PoorBest
Java does not directly support constants. However, a static final variable is effectively a constant.
The static modifier causes the variable to be available without loading an instance of the class where it is defined. The final modifier causes the variable to be unchangeable.
Java constants are normally declared in ALL CAPS. Words in Java constants are normally separated by underscores.
An example of constant declaration in Java is written below:
publicclassMaxUnits{
publicstaticfinalintMAX_UNITS=25;
}
创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!