Suppose we've taken an ArrayList as final.
final ArrayList<Integer> list = new ArrayList<>();
Next, we've added 10 elements to it. As we all know the default initial capacity of an ArrayList is 10. So, what will happen when we add the 11th element ? --> It'll create a new ArrayList of capacity = (currentCapacity * 1.5) i.e. 15, copy all the elements from the initial ArrayList object to this new ArrayList, and then point the reference "list" to this new ArrayList object. Eventually, Old ArrayList will be Garbage Collected.
But, the question is, since we've declared the ArrayList reference "list" as final, that means reinitialization of "list" is also not allowed ("list" was initially pointing to the ArrayList Object of capacity 10 --> then "list" will point to the ArrayList Object of capacity 15).
So, how is it that it'll still work fine and what is the logic behind it?