Comparable

public class Employee implements Comparable<Employee> {

	int age;

	@Override
	public int compareTo(Employee o) {
		// 优雅 优雅,舒服了!!
		return this.age - o.age;
	}
}
全部评论

相关推荐

牛客60022193...:大厂都招前端,他们觉得AI能替代前端,可能他们公司吊打btaj吧
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务