摘要: 我们都知道compare(int o1, int o2)方法 return o1 - o2 是升序,return o2 - o1 是降序。那么原因我们不妨跳进去源码看一下。 public static <T> void sort(T[] a, Comparator<? super T> c) { i 阅读全文
posted @ 2021-04-12 16:57 归鸿唱晚 阅读(633) 评论(0) 推荐(0)
摘要: int转String有3种方式 (1)num + "" (2)String.valueOf(num) (3)Integer.toString(num) String转int有2种方式 (1)Integer.parseInt(str) (2)Integer.valueOf(str).intValue( 阅读全文
posted @ 2021-04-12 14:07 归鸿唱晚 阅读(102) 评论(0) 推荐(0)