What is difference between mutable and immutable String in java
Case 1: String str = “Good”; str = str + ” Morning”; In the above code you create 3 String Objects. “Good” it goes into the String Pool. ” Morning” it goes into the String Pool as well. “Good Morning” created by concatenating “Good” and ” Morning”. This guy goes on the Heap. Note: Strings … Read more