How to define a constant variable in Java?
Answer / vidya bhushan dwivedi
The variable should be declared as static and final. So only one copy of the variable exists for all instances of the class and the value can't be changed also.
static final int MAX_LENGTH = 50; is an example for constant.
Is This Answer Correct ? | 6 Yes | 0 No |
Wha is the output from system.out.println(“hello”+null); ?
What is the difference between state-based unit testing and interaction-based unit testing?
What is a line break example?
What is “try and catch” in java
What is the symbol for average?
Is java hard to learn?
whats is the use of final,in which situation final can be used in the application?
What do you mean by order of precedence and associativity?
What is the independent variable in an experiment?
What is the difference between math floor and math round?
What are namespaces in java?
Why is java not 100% pure oops?