String s = new String("xyz");创建了几个字符串对象?

两个对象,一个是静态区的"xyz",一个是用new创建在堆上的对象。

Java Program!
原文地址:https://www.cnblogs.com/programb/p/12892505.html