+ 1

Can anyone help me with this in java. I am not to getting how to input in this.

https://code.sololearn.com/cdCojCy933vg/?ref=app

10th Jul 2020, 12:51 PM
Varun
Varun - avatar
6 Answers
+ 1
import java.util.*; This .* will import all all classes which are in util package so again no need to write import java.util.Scanner; But if not need all classes, then don't use to import all classes. But here you are using only extra Scanner class methods, then java.util.Scanner; is enough.. Unnecessary classes importing will slowdown execution. Remove all those extra unnecessary charecters.. Enough all static method, but All is in same class hence no need to call through class name. just ex: sum(2,3) is enough.. So your program has only extra hidden charecters, remove all and give input by require space separating or line by line.. Ex: 2 1 1 ( for addition.)
10th Jul 2020, 1:11 PM
Jayakrishna šŸ‡®šŸ‡³
0
There are lots spaces which are not just space but some hidden characters "\u0000" So clear the spaces.. and while calling a static method u should call it wilth this syntax : classname.method_name()
10th Jul 2020, 12:59 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
0
Thanks. I checked into it . But it still tells me tha my input should be I multiple lines.This is not the case in normal java. I don't know if it is happening in everyones program or not.
10th Jul 2020, 1:00 PM
Varun
Varun - avatar
0
Yes I saw that. Thanks
10th Jul 2020, 1:12 PM
Varun
Varun - avatar
10th Jul 2020, 1:19 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
0
Not able to answer in DM. Not working for me. nextInt() will not ask you input in separate line.. Only nextLine() will consume entire line and goes to next line for next input.. So in this program, you can input just input like 4 5 1 as a space separated, in separate lines also works but not need... Try and reply if any problem....
10th Jul 2020, 1:21 PM
Jayakrishna šŸ‡®šŸ‡³