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

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

posted @ 2020-07-05 13:51  咔啡  阅读(779)  评论(0)    收藏  举报