If instance variable is set final its value can not be changed like
public class Final { private final int b; Final(int b) { this.b = b;
When a reference is final, it cannot be linked to any other object.
The values of the object can be changed, so you can add values to the map, but cannot change the object of the map.