初学java 帮我看下这代码的问题在哪里 ?
public class TestThread {
public static void main(String[] args) {
MYFirstThread first = new MYFirstThread() ;//这里有错
SecondThread second = new SecondThread();;//这里有错
first.start();
second.start();
try{
System.out.println("Waiting for first thread finished..");
first.join();
System.out.println("It is a long wait!!");
System.out.println("Waking up Second thread!");
second.resume();
System.out.println("Waiting for Second Thread finished..");
second.join();
}catch (InterruptedException e) {
// TODO: handle exception
}
System.out.println("I am finished too");
}
class MYFirstThread extends Thread {
public void run() {
try{
System.out.println("First Thread Start!");
sleep(1000);
System.out.println("First Thread Stoped!");
}catch (InterruptedException e){
}
}
}
class SecondThread extends Thread{