When i use Scanner in my code then my program only in running state it not completed

57 Views Asked by At

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

There are 1 best solutions below

0
JialeDu On

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.

  • You can add the following setting to make the result output in the TERMINAL panel

        "code-runner.runInTerminal": true,
    
  • The best solution is to use the official java extension package to execute the script.

    enter image description here

    enter image description here

    Run Java instead of Run Code