InterviewSolution
| 1. |
What Is The Final Field Modifier? |
|
Answer» When you declare variable in a CLASS FINAL, you tell the compiler that the -variable has a constant value that program should not change. To DEFINE a final variable, you must also include an INITIALIZER that assigns a value to the constant. For example, the following statement creates a constant value NAMED MAXJCEYS, to which the program assigns the value 256: protected static final int MAX_KEYS = 256; When you declare variable in a class final, you tell the compiler that the -variable has a constant value that program should not change. To define a final variable, you must also include an initializer that assigns a value to the constant. For example, the following statement creates a constant value named MAXJCEYS, to which the program assigns the value 256: protected static final int MAX_KEYS = 256; |
|