pruebaestados.java
来自「example in C using threads」· Java 代码 · 共 24 行
JAVA
24 行
import java.io.*;
public class PruebaEstados {
static PrintWriter salida = new PrintWriter(System.out, true);
public static void main(String args[]) {
PrimerThread primer = new PrimerThread();
SegundoThread segundo = new SegundoThread();
primer.start();
segundo.start();
try {
salida.println("Esperando el fin de ejecucion del primer Thread...");
primer.join();
salida.println("Demasiada espera!");
salida.println("Levantando el segundo Thread...");
synchronized (segundo) {
segundo.notify();
}
salida.println("Esperando el fin de ejecuci髇 del segundo Thread...");
segundo.join();
} catch (InterruptedException e) {
}
salida.println("Termin
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?