public class Z { public static void main(String[] args) { String s = "a"+"b"+"c"+"d"; System.out.println("s = " + s); } }
因为它是在常量池创建了一个对象
public class Z { public static void main(String[] args) { String s = "a"+"b"+"c"+"d"; System.out.println("s = " + s); } }
因为它是在常量池创建了一个对象