java - How many String objects will be created here? -
string x = new string("xyz"); string y = "abc"; x = x + y; how many string objects created in code?
there @ least 4 objects:
- the interned string
"xyz" - the copy of interned
"xyz"string - the interned string
"abc" - the result of concatenating 2 strings.
Comments
Post a Comment