一道String对象的面试题
String x1 = new String("c") + new String("d"); x1.intern(); String x2 = "cd"; System.out.println(x1 == x2); //? String x3 = new String("cd"); x3.intern(); String x4 = "cd"; System.out.println(x3 == x4); //?
以上代码块中第4行和第9行的输出分别是什么?
String x1 = new String("c") + new String("d"); x1.intern(); String x2 = "cd"; System.out.println(x1 == x2); //? String x3 = new String("cd"); x3.intern(); String x4 = "cd"; System.out.println(x3 == x4); //?
以上代码块中第4行和第9行的输出分别是什么?
相关推荐