摘要: 问题展示代码: public static void test01() { String str = "str"; new Thread(()->{ str += "yes"; System.out.println(str); }).start(); } 在jdk1.8下, 在lambda表达式中访 阅读全文
posted @ 2024-06-22 15:19 老婆大人很温柔 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 共同点 Comparable 和 Comparator 他们都可以实现集合的排序功能; 区别 Comparable 被实现类实现后, 需要重写compareTo方法, 方可使用Collections/Arrays工具类提供的排序方法进行排序; Comparator 被实现类实现后, 也可以重写com 阅读全文
posted @ 2024-06-18 18:34 老婆大人很温柔 阅读(2) 评论(0) 推荐(0) 编辑