public PrimesThread(intnum) { if (num< 2) throw new IllegalArgumentException(); this.num = num; } public void run() {//定义run函数,实现run函数的代码被作为一个独立的线程执行 if(num>=2) System.out.print(\ for(int x=2;x public class Primes{ public static void main(String args[]) { if (args.length == 0) { System.out.println(\未传入参数args,请在arguments中设置参数\ System.exit(0); } else new Thread(new PrimesThread(Integer.parseInt(args[0]))).start(); } } 百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库湖南大学操作系统作业(2)(2)在线全文阅读。
相关推荐: