#what is the difference between these codes
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
the left code is incomplete. it never actually takes any input
the right code let's u enter something and also prints it out again
(but it incorrectly closes the scanner, that's technically a bug)
I took the wrong screenshot
and how does right incorrectly close the scannr
scanners tied to System.in must not be closed
cause that closes System.in, which is not sth ur supposed to do
this is just the very same code. but u put the entered text into a variable first
other than that, no difference
ah okay
Maybe You need to wait before you close your scanner. You close it immediately after opening.
again, scanners tied to System.in must not be closed at all
just dont call scanner.close() at all in this situation