0
Why its asking to enter digit only once?
I put two scanner ,but here when I run code it shows once only once and shows some exception error. https://code.sololearn.com/cVXX8DGK2Qy9/?ref=app
4 Answers
+ 1
Remove line 12
Change line 15 to -
num2 =digit.nextInt();
Also š Ankurš do not create more than one instance of scanner class, it can be avoided almost 90% of time. Just a single instance is more than enough for pretty much all the basic programs we write.
Edit: It is allowed or not is secondry, I'm saying it's unnecessary. Hope you get the difference.
+ 1
Avinesh still same but got it ,it doesn't allow 2 or more scanner obj,
and yes I got your point šāļø
0
That's sad , anyway thanks āļøš
0
Yes I got the difference ,thanks