No, the last keyword does not make the list, or its contents unchanged. If you want an immutable list, you should use:
List<Synapse> unmodifiableList = Collections.unmodifiableList(synapses);
What the last keyword does does not allow us to assign a new value to the synapses variable. Ie you cannot write:
final List<Synapse> synapses = createList(); synapses = createNewList();
You can, however, write:
List<Synapse> synapses = createList(); synapses = createNewList();
Mark P.
source share