Tuesday, 22 May 2012

java threads different streams

this code reads numbers from different steam data , and outputs the whole sum. is there something wrong with this code ? how can i fix it ? public class Thr extends Thread{ static int numThr=100, sum=0; private int num; private Thr(int num){this.num =num;} public void run() { int k = IntegerReader.get(num); int count=0; while(k>0) { if(count%numThr==num) sum+=k; count

No comments:

Post a Comment