final variable in methods in Java [duplicate]

It simply makes the local variable books immutable. That means it will always be a reference to that same Book object being created and built, and cannot be changed to refer to another object, or null.

The Book object itself is still mutable as can be seen from the sequence of accessor calls. Only the reference to it is not.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)