Home > Back-end >  Java for help
Java for help

Time:10-17

Beginners Java help
A single line of sc. NextLine () what meaning be?

Really want to find a big teach me

CodePudding user response:

Empty the input buffer (also remove the newline)
Such as you enter 123 456 XXXXX
N=123, m=456, and the rest of the XXXXX and line breaks in the input buffer, if not clear, the data behind the [0] read information is wrong,

CodePudding user response:

Well solve! Thank you
  • Related