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 is a line break example?
Is alive in java?
What is argument in java?
What is difference between hashset and hashmap?
Which java version is latest?
Can we override constructor?
Can we initialize the final blank variable?
Hai friends I am MCA 2006 passout. Spend time in 1 yr for teacing and 5 months in small s/w firm. worked in 4 or 5 months in few places. Presently I am writing bank exams. I want to get back to IT sector. Are there any possibilities. any growth prospects?. I am having some knowledge in core and advanced java. I am so desperate. Any suggestions thanks in advance. u can write to my mail mahidestiny@gmail.com
What are the features of java?
How many methods does cloneable interface contains?
What are thread local variables?
What is subsequence of a string?