Below is a Java program.
public String makinStrings() {
String s = “Fred”;
s = s + “47”;
s = s.substring(2, 5);
s = s.toUpperCase();
return s.toString();
}
How can I find out how many String object is created in the String pool. I think there are 4 objects created which are - "Fred" , "Fred47" , "ed4" , "ED4". Is this correct assumption?