MyThread mt1 = new MyThread(); MyThread mt2 = new MyThread(); mt1.setName("线程1"); mt2.setName("线程2"); mt1.start(); mt2.start(); } } class MyThread extends Thread{ public void run(){ static int x = 100; static int b = 10; Random r = new Random (); synchronized (MyThread.class) { for (int i = 0; i <=90; i++) { break; } } System.out.println(getName()+"抽选了"+r.nextInt(b--)); }MyThread mt1 = new MyThread(); MyThread mt2 = new MyThread(); mt1.setName("线程1"); mt2.setName("线程2"); mt1.start(); mt2.start(); } } class MyThread extends Thread{ public void run(){ static int x = 100; static int b = 10; Random r = new Random (); synchronized (MyThread.class) { for (int i = 0; i <=90; i++) { break; } } System.out.println(getName()+"抽选了"+r.nextInt(b--)); }MyThread mt1 = new MyThread(); MyThread mt2 = new MyThread(); mt1.setName("线程1"); mt2.setName("线程2"); mt1.start(); mt2.start(); } } class MyThread extends Thread{ public void run(){ static int x = 100; static int b = 10; Random r = new R