Answer Posted / 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 |
Post New Answer View All Answers
If try block is successfully executed, Then Is Finally block executed?
What is difference between array and arraylist in java?
Explain a few methods of overloading best practices in java?
What is primitive data type in java?
What is final keyword in java?
What is difference between string and new string?
What is meant by main method?
Explain the difference between static and dynamic binding in java?
What is the purpose of static methods and variables?
How will you print number in reverse (descending) order in BST.
What is the best definition for data?
What is static import in java?
What is the difference between equals() and?
Explain the difference between a Thread and a Process.
Explain implementation and how is it different from conversion?