• 07 May

    Why String is immutable in java

    String class is immutable in java. If you take dictionary meaning of immutable, it means unable to be changed or unchanging over time, so String is unchangeable or unmodifiable in java. Let’s understand with example. [crayon-60ce0f5800e4a982546426/] As you can see, value of str1 did not change. It created another String object with value “Hellojava2blog” but […]