0
How to Use Two Scanner in Java.
Please Help me I want Two Scanner in Java but i don't know how to use two scanner.
10 odpowiedzi
+ 7
So you want something like this?
https://code.sololearn.com/c9sYfM6fJ3vT/?ref=app
You just create one Scanner object for that.
Scanner sc = new Scanner(System.in);
Then with the help of the Scanner object sc you call your required methods and assign them to appropriate variables.
e.g.
int a = sc.nextInt();
int b = sc.nextInt();
+ 6
Can you please elaborate a little more?
Where and how you're supposed to use Scanner class?
+ 4
You're welcome 😊
0
I was Using two int to take two numbers and then add,divide, multiply or subtract a number chosen by the user.
I just Want to use first Scanner to take the first number and then second Scanner to take Second Number. Please help me
0
Can I take two input using one Scanner??
0
Like I can use sc to take two input in a and b.
0
Let me check
0
Ya It is Working Thank You.