public class Stage extends Thread { @Override public void run() { // TODO Auto-generated method stub Army suiArmyTask = new Army(); Army rebelArmyTask = new Army(); Thread suiArmy = new Thread(suiArmyTask, "隋军"); Thread rebelArmy = new Thread(rebelArmyTask, "起义军"); suiArmy.start(); rebelArmy.start(); try { Thread.sleep(5); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } suiArmyTask.keepFighting = false; rebelArmyTask.keepFighting = false; try { rebelArmy.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } }}