Thread questions.
Ok, I have decided to write a new mini thread program so I can learn it...
class printerimplements Runnable{
publicvoid run(){
while (1==1){//WHILE HERE?
System.out.println("TEST");
}
}
}
class threadTest{
publicstaticvoid main(String[] args){
threadTest frame =new threadTest();
while (1==1){//WHILE HERE?
printer ww =new printer();
Thread wt =new Thread(ww);
wt.start();
}
}
}
Notice where I have "WHILE HERE?" If I am threading an application, which is the better one if I want to have it print "TEST" over and over while threading?, Im guessing its in the threaded... but then it leaves me with the problem of sleep... I know I need it within a Try block, and I have tried doing so but I cannot get it to work. I probably have the Try block in the wrong place.
EDIT: Ok, I got the sleep to work... and I assume I am correct about while being in the threaded class?
Message was edited by:
Evilsanta

