Final Keyword

Java 11 Certification Practice Questions (For the complete list, refer to http://talks.skilltoz.com/java-11-certification-exam-questions/

Marking a variable final means the value cannot be changed after it is assigned.

When a reference variable is marked final, it means that the variable cannot be made to refer to another object. Even though a final variable cannot be made to refer to another object, there is no harm in modifying the object itself.

References

https://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.4

Leave a Reply

Your email address will not be published. Required fields are marked *