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

public class Thread_demo4 {

    public static void main(String[] args) {
        /*
            需求:
                死锁
         */
        MyThread3 t1 = new MyThread3();
        MyThread3 t2 = new MyThread3();

        t1.setName("线程A");
        t2.setName("线程B");

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