How many string objects are created?
This is a very common java interview question.
Given the following:
String x = new String("xyz");
y="abc";
x=x+y;
How Many Strings have been created:
A - 2
B - 3
C - 4
D - 5
To answer this question, I suggest you to read
One answer I agree with: