Even though String
is a final
class we can change the value of it like:
String A = "hello";
And in next step:
A = "World";
Here A
will be changed.
Whereas in case of a final variable we can't do it like:
final int a =10;
a = 13; //This Will Give Error
This would be a contradiction.