Interview answers verified by specialists.

Find interview questions and answers on this website:


See right interview answers on 30 common job interview questions

How to define a constant variable in Java?

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.