类为Student: public boolean equals(Object obj) { if (obj == null || obj.getClass() != Student.class) { return false; } Student tmp = (Student)obj; return No == tmp.No; }