#why are my console inputs not getting read?

1 messages ยท Page 1 of 1 (latest)

whole mothBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#

There could be several reasons why your console inputs are not getting read in Java. Here are a few common issues and possible solutions:

  1. Make sure you are using the correct input method: If you are trying to read input from the console, you should use the Scanner class in Java. Make sure you have imported the Scanner class and created an instance of it to read input.

  2. Check for any errors in your code: Make sure there are no syntax errors or logical errors in your code that could be causing the input reading to fail. Double-check your code for any mistakes.

  3. Ensure that you are properly handling exceptions: When reading input from the console, it is important to handle any exceptions that may occur, such as InputMismatchException or NoSuchElementException. Make sure you have proper error handling in place to catch and handle these exceptions.

  4. Verify that the console is active and responsive: Sometimes, issues with reading console inputs can be due to problems with the console itself. Make sure that your console is active and responsive, and try restarting it if necessary.

If you continue to experience issues with reading console inputs in Java, consider posting your code on a platform like Pastebin and seeking help from other developers who may be able to identify the problem.

grave shell
#
  1. dont create multiple Scanner with System.in, currently each loop iteration creates a new Scanenr object with System.in, dont do that, use one generalized Scanner for console
hidden tree
grave shell
#

it is outside one of the while loop

#

but still in the other one lol

hidden tree
grave shell
#

it doesnt matter for the file you are scanning