PDA

View Full Version : Why String is final in Java?



bhavnasingh482
07-27-2017, 09:01 AM
Hi friends,
I would like to know,
Why String is final in Java?

programmers.io
03-28-2022, 11:02 AM
The String class in the java. lang package is a final class for just this reason. The String class is so vital to the operation of the compiler and the interpreter that the Java programming (https://programmers.io/java/) system must guarantee that whenever a method or object uses a String they get exactly a java.