package chapter03;public class Test01 {public static void main(String[] args) {//串行执行:多个线程连接成串,然后按照顺序执行//并非执行:多个线程是独立的,誰抢到了CPU的执行权,誰就能执行Mythread1 t1 = new Mythread1();Mythread2 t2 = new Mythread2();t1.start();try{t1.join();}catch (InterruptedException e){}t2.start();try{t2.join();}catch (InterruptedException e) {}System.out.println(Thread.currentThread().getName());} } class Mythread1 extends Thread{@Overridepublic void run() {System.out.println(Thread.currentThread().getName());} } class Mythread2 extends Thread{@Overridepublic void run() {System.out.println(Thread.currentThread().getName());}