M
MrFredBloggs
If I have a string:
String parentString = new String("This is a string");
and I call:
String childString = parentString.subString(10, 16); //==> "string"
I understand that I have created a new instance of String called
childString.
However, does childString now internally contain the char[] array:
private char[] data = char[] {'s', 't', 'r', 'i','n', 'g'};
or does it still refer to the char[] array in parentString.
Regards,
Fred.
String parentString = new String("This is a string");
and I call:
String childString = parentString.subString(10, 16); //==> "string"
I understand that I have created a new instance of String called
childString.
However, does childString now internally contain the char[] array:
private char[] data = char[] {'s', 't', 'r', 'i','n', 'g'};
or does it still refer to the char[] array in parentString.
Regards,
Fred.