public class ckeef
{ public static void main(String args[])
{ String s1,s2,s3,s4;
s1=new String("we are students");
s2="We are students";
s3="We are students";
s4=new String(s1);
System.out.println(s1.equals(s2));
System.out.println(s3==s2);//s2和s3为什么是对的??
System.out.println(s1.equals(s4));
System.out.println(s1==s4);//s1和s4的引用不是一样的么?为什么输出的是false??
}
}
菜鸟求解!!!!!!
沧海一幻觉
米脂