equals()----默認是比較兩個對象的地址值是否相等

代碼: package cn.tedu.object; public class ObjectDemo5 { public static void main(String[] args) { //創建對象 Person p1=new Person(); p1.name=new String(「lili」); // p1.name=null; p1.age=10; p1.gender=‘女’; Pe
相關文章
相關標籤/搜索