Java Scanner.nextLine() not waiting for input

前端 未结 2 698
醉话见心
醉话见心 2020-12-07 03:06

I have several methods that I\'ve used previously to accept user input and return it as a certain data type to the method that calls for it. I have used these methods, or v

2条回答
  •  太阳男子
    2020-12-07 03:50

    Please don't close the Scanner.

    scan.close();    // Don't do it.
    

    Doing that is causing the problem.

提交回复
热议问题