==和equals()的区别
String tom = "I am student";
String jerry = "I am student";
tom == jerry ---------true; == 是看地址引用是否相同-------------引用 内存地址
tom.equals(jerry)-----true; equals是看对象内容-------------------实体 内存
String tom = new String("I am student");
String jerry = new String("I am stundet");
tom == jerry--------false
tom.equals(jerry)---true |
|