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 do you mean by append?
Do I need to import java.lang package any time? Why?
Can we access the non-final local variable, inside the local inner class?
What is the set interface in java programming?
How do you detect memory leaks?
Why we do exception handling in java and how many types of exceptions are there?
What are the properties of thread?
Is constructor inherited?
What are the files generated after using IDL to java compiler?
what is the difference between @include page and @include file
How to create a thread in java?
Can array grow dynamically in java?