CodesJava

Easy learning with example program codes

Why string objects are immutable in java?


Java uses the concept of String literal. Suppose n reference variables refer to one object “codesjava”. If one reference variable changes the value of the object, it will be affected to all other n-1 reference variables. That’s why string objects are immutable in java.

Java interview questions on string handling

Please follow and like us:


Copyright © 2019 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki