Java Tips - How do I declare a constant in Java
2012-05-30 15:04
260 查看
Java Tips - How do I declare a constant in Java
User Rating:
/ 140
PoorBest
How do I declare a constant in Java |
/ 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:
|
相关文章推荐
- How Do I Declare A Block in Objective-C?
- So how to declare a const table in Java?
- How Do I Declare A Block in Objective-C?
- In Java, how do I read/convert an InputStream to a String? - Stack Overflow
- [Java Tips] How to Use StringTokenizer in Java?
- How do you calculate log base 2 in Java for integers?
- How Do I Declare A Block in Objective-C?
- How do I join two lists in Java?
- How do I compare strings in Java?(Stackoverflow)
- How do I instantiate a Queue object in java?
- How Do Annotations Work in Java?--转
- How Do I Declare A Block in Objective-C?
- How Do I Declare A Block in Objective-C?
- How do you specify a byte literal in Java?
- Spring MVC 入门示例讲解 - howtodoinjava
- Spring MVC 入门示例讲解 - howtodoinjava
- How do I setup JAVA_HOME and Path variables in Windows?
- How Do I Declare A Block in Objective-C? [备忘]
- How Do I Declare A Block in Objective-C?
- How Do I Declare a Closure in Swift?