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
What is widening and narrowing in java? Discuss with an example.
What language is pass by reference?
Write a java program for binary search?
Which java collection does not allow null?
What is default constructors?
What do you mean by access modifier?
How do you calculate roots in java?
Explain the difference between collection api and stream api in java8?
What is the meaning of I ++ in java?
What is the different types of functions?
In java, how we can disallow serialization of variables?
What is a nested list?
Explain OOPs concept.
How to create a base64 decoder in java8?
How to make a class or a bean serializable?