+ 3

How to get users data in java

like if I want 2 numbers from them

15th Jun 2018, 3:34 PM
md. adil
md. adil - avatar
2 Answers
+ 2
https://code.sololearn.com/cq3Sdc0Q8Q6x/#java import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int firstNum = 0; int secNum = 0; System.out.println("First user input: "); firstNum = scnr.nextInt(); System.out.println("Second user input: "); secNum = scnr.nextInt(); System.out.println("User entered " + firstNum + " and " + secNum + "."); } } ::: OUTPUT :::: First user input: Second user input: User entered 4 and 20.
15th Jun 2018, 3:39 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
thnx
16th Jun 2018, 3:47 PM
md. adil
md. adil - avatar