public static void main(String[] args) {
Runnn run = new Runnn();
new Thread(run).start();
new Thre().start();
new Thread(){
public void run(){
System.out.println("方式三");
}
}.start();
}
}
class Runnn implements Runnable {
public void run() {
System.out.println("方式一");
}
}
class Thre extends Thread {
public void run() {
System.out.println("方式二");
}
} |
|