Suppose I have a main thread and a normal thread, the execution of which is greater than the first.
Something like that:
public class Test{
private int count;
public void doTest(){
(new MyThread()).start();
}
public static void main(String[] args){
Test t = new Test();
t.doTest();
}
private class MyThread extends Thread{
public void run(){
while(count < 100){
count++;
..wait some secs ...
}
}
}
}
Is it wrong to leave such a code? Or would it be more proper to execute join () on a thread to ensure that it completed correctly?
Phate source
share