如题:public class T{public static void main(String[] agrs) {String s1 = "test";String s2 = "test"; System.out.println(s1 == s2);
T1 t1 = new T1();
T1 t2 = new T2();
System.out.println(t1.t() == t2.t());
}}class T1(){String t1(){return "test";}}class T1(){String t1(){retrun "test";}}输出的结果是: false true第二结果为什么是true。
添加回答
举报
0/150
提交
取消