+ 2
What's wrong with this?
about a test code https://code.sololearn.com/cojQa4ppbigI/?ref=app https://code.sololearn.com/cojQa4ppbigI/?ref=app
4 Antworten
+ 3
Also, you cant use 2 Scanner objects like you did. Just use one for input as many time you need.
x = num1.nextInt();
y = num1.nextInt();
.......
And Scanner num2 delete.
With this and what is said in Raj Chhatrala answer, your code will work.
+ 6
In java, everything must be wrapped in a function(method)
Last to print statements in your code are outside of your method.
Try wrapping then into a new method or in existing one.
+ 3
Oh yes, I missed to notice that two objects of scanner.
Nice catch vlada
+ 1
Raj Chhatrala vlada Thanks a lot! It's so nice of you.Without your help, I can't imagine how much time I will spend to fix the bug.