Final Answer:
The option is true because the use of the 'final' keyword in the declaration 'final int age = 21' restricts any subsequent modifications to the variable 'age.' Once a final variable is assigned a value, it cannot be altered, providing a mechanism for creating constants in Java.
Step-by-step explanation:
The use of the keyword 'final' in the declaration 'final int age = 21' indicates that the value assigned to the variable 'age' cannot be changed once it has been initialized. In Java, when a variable is declared as final, it becomes a constant, and any attempt to modify its value will result in a compilation error. Therefore, in the given scenario, the statement "age's value cannot be changed" is true.
In Java, the 'final' keyword is used to define constants. Once a final variable is assigned a value, it cannot be reassigned. This is particularly useful when you want to ensure that a variable retains a constant value throughout the program, preventing accidental modifications. In the case of 'int age = 21', the 'final' keyword ensures that 'age' remains 21 throughout the program's execution.
This feature is important in situations where the value of a variable should remain constant to maintain program integrity or when dealing with values that should not be altered. It enhances code clarity and helps prevent unintended side effects that may arise from modifying constant values. In summary, the 'final' keyword serves as a safeguard, signaling the programmer and the compiler that the value of the variable should not be changed once initialized.