public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int n=3;
int m=3;
System.out.println(n==m);
String str = new String("hello");
String str1 = new String("hello");
String str2 = new String("hello");
System.out.println(str1==str2);
str1 = str;
str2 = str;
System.out.println(str1==str2);
}
}
来源: https://mp.weixin.qq.com/s?__biz=MzI4Njc5NjM1NQ==&mid=2247484754&idx=1&sn=e0b32700feed5d6cc67c8fbae392e704&chksm=ebd63a7edca1b36828dab8f440ddb2fd75949661adbdae706afacbbbd9aae774e5954a8b0c3a#rd