Firstly, A not immutable; you simply declare it final .
Then the final variables cannot be changed. If obj1 is a field, this provides variability (as opposed to final class ).
If this is a local variable, this means that you can safely use it in anonymous classes (otherwise the compiler cannot be sure that it will not receive changes sometimes before / at the time the class is anonymous)
source share