If a class is defined as final and we declare an instance of the final class... Would it make any difference? or is final in such cases would be re
A final variable cannot be bound to another instance, so this is not valid:
final String s = "123";
s = "234"; // doesn't work!
A final class cannot be extended
final class A {
}
class B extends A { // does not work!
}
And both of this is not to be confused with immutable classes (like String). Instances of immutable classes won't change their state. (There is no direct language support for immutable classes, but in practice most of the time all attributes of immutable classes are declared final.)