I want to discuss about the functionning of the scanner class and how to not skip informations from the lines. We can see my post related to this subject in the topic of the forum Prix le plus bas [Facile]
In case of a matching product, all the tokens have been selected and imported into a fitted input. Right after this if(), there’s sc.nextLine(). But, javadoc says nextLine() advances this scanner past the current line and returns the input that was skipped.
From what i understand, it means the scanner selects the line following the line of this matching product and returns the content of the line of the matching product whic has already been treated.
The experience confirms it’s wrong. So, why is the line following this product skipped ?