running Threads-need HELP ps

hi all, i really need to submit this assignment and im at the point of banging my head on my PC coz java is making me run nuts.

i the code is working fine except that i need to run threads for any number of commands entered at input in the order in which thy're entered. i've written all commands in seperate classes and extended thread in each of them. all classes are working on a file so im calling them in my main class below. The for loop at the bottom of code is really giving me trouble. im sure i have to use if statements to run threads for commands entered. how can i do it. somebody help ps.

import java.io.*;

import java.util.*;

publicclass Command

{

publicstaticvoid main(String[] args)

{

Create cr =new Create();

cr.createFile();

//int numberOfCommands = // count how many commands there are on the line

String commandLine;

String s1 ="&;";

int numberofCommands;

System.out.print("Enter command: " );

try{

BufferedReader br =new BufferedReader(new InputStreamReader(System.in));

commandLine = br.readLine();

StringTokenizer st =new StringTokenizer(commandLine,"&;");

numberofCommands = st.countTokens();

System.out.println("Number of Commands = " + numberofCommands);

while (st.hasMoreTokens())

{

System.out.println(st.nextToken());

}

Thread t[] =new Thread[numberofCommands];

System.out.println("Threads created");

for (int i=0; i < numberofCommands; i++)

{

}

}catch (Exception e){}

}

}

[2692 byte] By [ssimkhana] at [2007-11-27 7:28:51]
# 1
Do you actually have a question?You're catching exceptions silently. Never do that. The solution to your problems may be in that catch block.Why are you sure that you need to use if statements?Why do you have that array of Thread?What are you trying to
paulcwa at 2007-7-12 19:08:59 > top of Java-index,Java Essentials,Java Programming...