public void run(){ ArmyRunnable armySuiDynasty = new ArmyRunnable(); ArmyRunnable armyRevolt = new ArmyRunnable(); //使用Runnable接口创建线程 Thread armyOfSuiDynasty = new Thread(armySuiDynasty,"隋军"); Thread armyOfRevolt = new Thread(armyRevolt,"隋军"); //启动线程,让军队开始作战 armyOfSuiDynasty.start(); armyOfRevolt.start(); //舞台线程休眠,大家专心观看军队的弑杀 try { Thread.sleep(50); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
它在舞台这个类中啊
所以说,Thread.sleep(); 这段代码的意思是:休眠它所在类的线程???
还是不懂楼上的意思?