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 a function in programming?
What are the properties of thread?
Can a class have multiple subclasses?
Why is stringbuffer not immutable?
What is the java idl system?
What are three advantages of using functions?
What are filterstreams?
How to check if linked list contains loop in java?
What string is utf8?
How is tree Mirroring implemented?
Is assembly language a low level language?
Difference between string, string builder, and string buffer?
how does multithreading take place on a computer with a single cpu? : Java thread
what is the volatile modifier for? : Java thread
What is an object's lock and which object's have locks in java programming?