标签:equals()方法重写
public class Student{ int age; int id; int name; public boolean equals(Object obj) if(this==obj){ return true; } if(obj instanceof Student){ Student stu=(Student)obj; if(stu.id==id&&stu.age==age&&stu.name==name){ return true; } } return false; }
本文出自 “gaogaozi” 博客,请务必保留此出处http://hangtiangazi.blog.51cto.com/8584103/1661207
标签:equals()方法重写
原文地址:http://hangtiangazi.blog.51cto.com/8584103/1661207