1.
String s1 = "Stack";
String s2 = s1.concat(" Overflow");
2.
String s1 = "Stack";
String s2 = s1+" Overflow";
Here, how many objects are created in heap and scp in both cases?
1.
String s1 = "Stack";
String s2 = s1.concat(" Overflow");
2.
String s1 = "Stack";
String s2 = s1+" Overflow";
Here, how many objects are created in heap and scp in both cases?