Need Assistance?

support@tutorialshub.in

Methods, Recursion & User Input

Reading User Input with Scanner

ADVERTISEMENT
Java Free Lesson
5 min read
ADVERTISEMENT

Use java.util.Scanner to read strings, integers, and decimals from System.in. Always consume the leftover newline after nextInt() by calling sc.nextLine() before reading a full line of text.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you