while(true){?? ??? ??? ?//提示輸入要刪除的學生的ID?? ??? ??? ?System.out.println("請輸入要刪除的學生ID!");?? ??? ??? ?String ID=console.next();?? ??? ??? ?//判斷該ID是否有對應的學生對象?? ??? ??? ?Student st=students.get(ID);?? ??? ??? ?if(st==null){?? ??? ??? ??? ?//提示輸入的ID并不存在?? ??? ??? ??? ?System.out.println("該ID不存在!");?? ??? ??? ??? ?continue;?? ??? ??? ??? ?}?? ??? ??? ?students.remove(ID);?? ??? ??? ?System.out.println("成功刪除學生:"+st.name);?? ??? ??? ?break;?? ??? ?}上面代碼中,while的判斷條件里放一個true是什么意思?有什么作用?
添加回答
舉報
0/150
提交
取消