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
[url]http://www.javaranch.com/journal/200409/Journal200409.jsp[/url]
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
[url]http://www.javaranch.com/journal/200409/Journal200409.jsp[/url]