Using the Scanner class in Java to get specific digits of an integer [duplicate]
问题 This question already has answers here : How to get the separate digits of an int number? (26 answers) Closed 3 years ago . I just started learning Java (two months and counting), and I still have lots of questions and a whole lot to learn. Right now I want to use the Scanner class to "divide" an integer into its digits. I'll explain myself better with an example: I request the user to type a four-digit integer, say 8919 . What I want to do is to use the Scanner class to divide that integer