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]
本文探讨了一道常见的Java面试题目:给定代码片段中创建了多少个字符串实例。通过解析代码并提供链接资源,帮助读者理解字符串创建的过程及计数方法。

被折叠的 条评论
为什么被折叠?



