如图,我就输入了“3”,还有“语文”,它就自己走了,还有有时候直接报错出inputMismatchException
List<course> containsList=new ArrayList<course>();
int choice;
System.out.println("需要查看包含几门课程?(0:结束查看。)");
choice=console.nextInt();
while(choice!=0){
for(int i=0;i<choice;i++){
System.out.println("请输入第"+(i+1)+"门课程名字");
course ccr=new course();
String newName=console.next();
ccr.setName(newName);
containsList.add(ccr);
System.out.println("已输入"+ccr.getName());
}
System.out.println("包含全部?"+coursesToSelect.containsAll(containsList));
System.out.println("还需要查看包含几门课程?(0:结束查看。)");
choice=console.nextInt();
}