Java题目,为何输出是 false true false true
publicstaticvoidmain(String[]args){Stringa="aa";Stringb=newString("aa");System.out.pr...
public static void main(String[] args) {
String a = "aa";
String b = new String("aa");
System.out.println(a==b);
System.out.println(a.equals(b));
String c = new String("aa");
System.out.println(a==c);
System.out.println(b.equals(c)); 展开
String a = "aa";
String b = new String("aa");
System.out.println(a==b);
System.out.println(a.equals(b));
String c = new String("aa");
System.out.println(a==c);
System.out.println(b.equals(c)); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询