wood burning stoves 2.0
The moose likes JDBC and Relational Databases 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 and Relational Databases
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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32501
    
214

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


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Threads
 
It's not a secret anymore!