关于多线程的问题?
public class WaitNotify extends Thread {
public static void main(String[] args) {
Thread notificationThread = new WaitNotify();
notificationThread.start();
try {
synchronized (notificationThread) {
System.out.println("before run wait method!");
//notificationThread.wait();
System.out.println("after run wait method!");
}
} catch (Exception e) {
}
System.out.println("the wait is over");
}
public void run() {
System.out.println("Hit enter to stop waiting thread!");
try {
System.in.read();
} catch (Exception e) {
}
synchronized (this) {
this.notifyAll();
}
}
}
请问在上面的程序运行时,总共有几个线程啊,都是那些个?
这个程序到底是怎么运行的啊(线程方面),我现在都晕了,拜托各位大哥了!