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 |
Can java object be locked down for exclusive use by a given thread?
Why is java architectural neutral?
How do you sort a list in java?
How do you classify Dialog Box?
How many types of string data types are there?
What is the purpose of the finalize() method?
If two threads have same priority which thread will be executed first ?
What is meant by design patterns?
What is primitive array?
What is Yield() method when we r using this ? tell exactly
explain multi-threading in java?
What is passing value java?