public class Equals_验证 {
public static void main(String[] args) {
String s1=new String("呵呵");
String s2=new String("呵呵");
String s3=s1;
System.out.println(s1==s2);
System.out.println(s1==s3);
System.out.println(s1.hashCode());
System.out.println(s2.hashCode());
}
}
怎么样才能输出s1或者s2的内存地址呢,这里的hashCode值不是其内存地址啊;
|
|