This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
//READ FILE W/STRING TOKENIZER & STORE VALUES IN VARIABLES while ((sline = br.readLine()) !=null) { StringTokenizer st=new StringTokenizer(sline, ","); intA = Integer.parseInt(st.nextToken()); intB = Integer.parseInt(st.nextToken()); TrArray[intTr] = new Tr(intA, intB, tnl); ThreadArray[intTr] = new Thread(TrArray[intTr]); ThreadArray[intTr].start(); }
I am reading a file from the command line which contains several lines. Each line contains 2 integers separated by a comma. (intA, intB). A Tr object is created (consisting of the 2 integers & tnl object) & assigned to an array as each line is read. Then each object needs to be assigned to a thread & started.
Error occurs on the: ThreadArray[intTr] = new Thread(TrArray[intTr]) line Error received is: Cannot resolve symbol constructor thread Train