Java两个线程交替输出(生产者和消费者模式)
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: ManolinCoder
*/
public class ThreadTest16 {
public static void main(String[] args) {
List list = new ArrayList();
Thread t1 = new Thread(new Producer16(list));
Thread t2 = new Thread(new Consumer16(list));
t1


4285

被折叠的 条评论
为什么被折叠?



