Java案例:Comparable接口用法
【摘要】
1、Employee
package net.hw.interfaces; /** * Created by howard on 2018/1/29. */public class Employee implements Comparable<Employee> { private String name; ...
1、Employee
-
package net.hw.interfaces;
-
-
/**
-
* Created by howard on 2018/1/29.
-
*/
-
public class Employee implements Comparable<Employee> {
-
private String name;
-
private double salary;
-
-
public Employee() {
-
}
-
-
public Employee(String name, double salary) {
-
this.name = name;
-
this.salary = salary;
-
}
-
-
public String getName() {
-
return name;
-
}
-
-
public void setName(String name) {
-
this.name = name;
-
}
-
-
public double getSalary() {
-
return salary;
-
}
-
-
public void setSalary(double salary) {
-
this.salary = sala
文章来源: howard2005.blog.csdn.net,作者:howard2005,版权归原作者所有,如需转载,请联系作者。
原文链接:howard2005.blog.csdn.net/article/details/79335634
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)