aspose file tools*
The moose likes JDBC and the fly likes Threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

Threads

Alex Green
Greenhorn

Joined: Nov 02, 2004
Posts: 4
//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

Any help would be appreciated

Thanks´┐ŻAlex
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29253
    
139

Alex,
Please don't cross-post the same question in multiple threads.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Threads
 
Similar Threads
Read integers from a file
sting tokenizer in a loop(vv urgent)
Extract all integers from a text file, how to do?
I/O
Threads/Arrays