英文:
When i use Scanner in my code then my program only in running state it not completed
问题
每当我在这个程序中使用Scanner时,程序进入运行状态但没有完成,如果完成了,那么它的输入就不起作用。但是当我将它移除后,它可以成功运行。我不知道在我的VSCode中发生了什么事情。首先,我尝试了Scanner,但它不起作用,然后我移除了Scanner并手动输入了数字,然后它起作用了。
英文:
Whenever i use Scanner is this program, the program goes to running state it is not completed, if it is completed then its input not working. But when i remove it successfully working. I don't know what happening in my vscode.enter image description here
Firstly i tried Scanner but its not working then i remove scanner and manually entered number then its worked.'
答案1
得分: 1
屏幕截图显示您正在使用Code Runner执行脚本,现在它在OUTPUT面板中输出结果,但OUTPUT面板无法接受输入。
- 您可以添加以下设置,使结果输出到TERMINAL面板
"code-runner.runInTerminal": true,
- 最佳解决方案是使用官方的Java扩展包来执行脚本。
请使用Run Java
代替Run Code
英文:
The screenshot shows that you are using Code Runner to execute the script, and now it outputs the result in the OUTPUT panel, but the OUTPUT panel cannot accept input.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论