- 1

Can help me with the class Scanner?

How do it use the class Scanner in java

4th Feb 2022, 10:30 PM
Fernando Arturo LĂłpez Cruz
Fernando Arturo LĂłpez Cruz - avatar
3 Answers
+ 4
Scanner var = new Scanner (System.in); If you want to read in an input, for example, you want the user to enter an integer (non-decimal number), you need to call: Int num = var.nextInt(); Or if you want to read in a String; String str = var.nextLine() https://code.sololearn.com/c4yofH1Bpxy1/?ref=app
5th Feb 2022, 2:04 AM
Denny Laplante
Denny Laplante - avatar
+ 2
https://www.w3schools.com/java/java_user_input.asp
5th Feb 2022, 12:18 AM
L.M.Paredes
L.M.Paredes - avatar
0
Thank you
5th Feb 2022, 1:05 AM
Fernando Arturo LĂłpez Cruz
Fernando Arturo LĂłpez Cruz - avatar