package chapter7;public class demo3 { static int a[]=new int[10000]; public static void main(String[] args) { Runnbale1 r1=new Runnbale1(); Runnbale2 r2=new Runnbale2(); new Thread(r1).start(); new Thread(r2).start(); } private static class Runnbale1 implements Runnable{ public void run() { for(int i=0;i<10000;i++) { a[i]=(int)(100+Math.random()*(999-100)); } } } private static class Runnbale2 implements Runnable{ public void run() { for(int i=0;i<10000;i++) { if(issushu(a[i])) { System.out.println(a[i]); } } } boolean issushu(int num) { int i; for(i=2;i