fibonaccitest.java
来自「java threads 3th源码,包括各个章节的源代码」· Java 代码 · 共 20 行
JAVA
20 行
package javathreads.examples.ch08.example6;
import java.util.*;
import java.util.concurrent.*;
public class FibonacciTest {
public static void main(String[] args) {
ArrayBlockingQueue<Integer> queue;
queue = new ArrayBlockingQueue<Integer>(10);
new FibonacciProducer(queue);
int nThreads = Integer.parseInt(args[0]);
for (int i = 0; i < nThreads; i++)
new FibonacciConsumer(queue);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?