随笔分类 -  Java

摘要:![image](https://img2024.cnblogs.com/blog/2743769/202407/2743769-20240731133047003-1948318666.png) 阅读全文
posted @ 2024-07-31 13:31 jarico 阅读(35) 评论(0) 推荐(0)
摘要:新建函数接口 Operation @FunctionalInterface public interface Operation<R, T> { R operator (T t1, T t2); } 在测试类中实现 public class TestDemo { @Test public void 阅读全文
posted @ 2022-10-03 21:14 jarico 阅读(24) 评论(0) 推荐(0)
摘要:default关键字 定义一个Animal接口 其中breath用default修饰。 public interface Animal { void run(); void eat(); default void breath(){ System.out.println("呼吸"); } } 定义一 阅读全文
posted @ 2022-10-03 18:24 jarico 阅读(29) 评论(0) 推荐(0)
摘要:public class DeadLockDemo { private static final Object HAIR_A = new Object(); private static final Object HAIR_B = new Object(); public static void m 阅读全文
posted @ 2022-09-25 23:53 jarico 阅读(21) 评论(0) 推荐(0)
摘要:public class TestDemo { @Test public void testCountDownLatch() throws InterruptedException { CountDownLatch countDownLatch = new CountDownLatch(5); fo 阅读全文
posted @ 2022-08-26 23:22 jarico 阅读(27) 评论(0) 推荐(0)