我跟着老师打的,为什么会出错?
Thread armyOfDynasty = new Thread(armyTaskOfSuiDynasty, "隋军");
//这句出错,错误: The constructor Thread(ArmyRunnable, String) is undefined
Thread armyOfRevolt = new Thread(armyTaaskOfRevolt, "农民军");
//这句同上错误
armyOfDynasty.start();
armyOfRevolt.start();
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
armyTaskOfSuiDynasty.keepRunning = false;//这句出错,错误是:keepRunning cannot be //resolved or is not a field
armyTaaskOfRevolt.keepRunning = false;//这句同上