Q1
What is the purpose of the 'final' keyword when applied to a variable in Java?
mediumCorrect Answer: It prevents the variable from being reassigned after its initial value is set
Explanation:
Once a final variable is assigned a value, attempting to reassign it causes a compile-time error. This is commonly used for constants, though for object references it only prevents reassigning the reference, not changing the object's internal state.