摘要:
函数式接口(Functional Interface) 定义:仅含一个抽象方法的接口(可添加@FunctionalInterface注解) @FunctionalInterface interface Calculator { int calculate(int a, int b); default 阅读全文
posted @ 2025-03-13 22:13
头发少的文不识
阅读(14)
评论(0)
推荐(0)
摘要:
一、线程通信与协作 wait()与notify()机制 作用:实现线程间条件等待与唤醒(必须在同步代码块中使用) 经典示例(生产者-消费者模型): class Buffer { private Queue queue = new LinkedList<>(); private int capacit 阅读全文
posted @ 2025-03-13 22:12
头发少的文不识
阅读(18)
评论(0)
推荐(0)
浙公网安备 33010602011771号