简介
要实现compareTo函数需要实现接口Comparable这个接口
然后这个接口中只有compareTo函数实现一下就可以用Collections.sort等方法.
equals 如果不重写, 比较的是地址. 重写后, 比较的是自己写的比较函数.
参考链接
https://blog.csdn.net/qq_43576028/article/details/90347117
Hope is a good thing,maybe the best of things,and no good thing ever dies.----------- Andy Dufresne