I know String in Java is immutable. Consider:
String s = "Java";
s = s.concat(" is simple");
System.out.println(s); //prints Java is simple
Here the value of String s is changed? Can someone explain me, how String concat actually works?
I know String in Java is immutable. Consider:
String s = "Java";
s = s.concat(" is simple");
System.out.println(s); //prints Java is simple
Here the value of String s is changed? Can someone explain me, how String concat actually works?