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 |
What is a newline character in java?
Can we have multiple catch block for a try block?
what is java
What is an object?s lock? Give name of object?s that have locks?
Can a abstract class be declared final?
What is the difference between Stream Reader and Stream Writer?
how to handle exceptions in ejb?
What is meant by JVM? Is JVM platform independent or not?
What are the two ways in which thread can be created?
Difference between this() and super() ?
Can you sort a string in java?
Define canvas?