How can I clear the Scanner buffer in Java? May 16, 2023 by Tarik Try this: in.nextLine(); This advances the Scanner to the next line.