为了账号安全,请及时绑定邮箱和手机立即绑定

这个代码中的console.next()方法一直报错,问题出在哪里?有哪位大神帮忙回答一下!!!

这个代码中的console.next()方法一直报错,问题出在哪里?有哪位大神帮忙回答一下!!!

xusongaicpp 2016-07-12 17:49:32
public void testModify(){ System.out.println("请输入要修改的学生ID:"); //创建一个Scanner对象,去获取从键盘上输入的学生ID字符串 Scanner consle=new Scanner(System.in); while(true){ String stuID=Console.next(); student student =students.get(stuID); if(student==null){ System.out.println(); continue; } System.out.println("当前该学生ID,所对应的学生为:"+student.name); String name = Console.next(); student newStudent = new student(stuID,name); } }这个代码中的console.next()方法一直报错,问题出在哪里?(JAVA基础第三季,5.4节)
查看完整描述

4 回答

?
苏州河1991

TA贡献46条经验 获得超29个赞

其他的不知道,单就while(true)没有break语句,就觉得会报错了


查看完整回答
反对 回复 2016-07-12
  • 4 回答
  • 0 关注
  • 2274 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信