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 |
How can we create a thread in java?
Which sorting algorithm is in place?
What is int lol?
What is meant by class loader? How many types are there?
What is final variable?
where final and static variable stored?
What is the collections api?
What is treeset in java?
What is multiple inheritance & can we implement it in java?
What is core java called?
How do you compare objects in java?
What is difference overloading and overriding?