File size: 389 Bytes
0284885
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package Thread_method_package;


public class Thread_demo4 {
    public static void main(String[] args) {
        /*
            public static void yield ()         出让线程/礼让线程
         */
        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();

        t1.setName("飞机");
        t2.setName("坦克");

        t1.start();
        t2.start();
    }
}