JS 与 trick 代码的运用及解析全攻略
978
2022-10-27
把业绩最低的两个员工删除
package com.xinzhi.api;import java.util.Objects;public class Staff { private String name; private int age; private int score; public Staff() { } public Staff(String name, int age, int score) { this.name = name; this.age = age; this.score = score; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public int getScore() { return score; } public void setScore(int score) { this.score = score; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Staff staff = (Staff) o; return age == staff.age && score == staff.score && Objects.equals(name, staff.name); } @Override public int hashCode() { return Objects.hash(name, age, score); } @Override public String toString() { return "Staff{" + "name='" + name + '\'' + ", age=" + age + ", score=" + score + '}'; }}
package com.xinzhi.list;import java.util.ArrayList;import java.util.Comparator;//把业绩最不好的两个员工给删了public class Test01 { public static void main(String[] args) { ArrayList
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~