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 |
could you run the java program without main method?
Can we define static methods inside interface?
Can we inherit the constructor in a Class?please give one example.
Describe inheritance as applied to java?
What is toarray method in java?
What is communist flag?
What is an off by one error in java?
What problems will occur when you don?t use layout managers?
What is a function in java?
What is the same as procedures?
How many types of modifiers are there?
how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion