0
Why this NoSuchElement java error is coming?
15 ответов
+ 2
SOUPTIK NATH Check this Edited By me. Read problem again.
https://code.sololearn.com/clXeNl2b7soO/?ref=app
+ 2
SOUPTIK NATH You can pass Scanner object as a parameter. No need to create 2 object.
+ 2
SOUPTIK NATH Give some time.
+ 2
SOUPTIK NATH I had taken Scanner as a parameter Because Sololearn is giving exception.
+ 2
SOUPTIK NATH Sololearn terminal is different. Maybe because of online compiler.
+ 2
Where do you specify your constructor?
+ 1
AJ #Infinity Love Thanks
0
Why you are taking input in 2 different methods. Take in main method and pass the array in another method.
0
AJ #Infinity Love The question is like that only.
https://www.sololearn.com/post/424635/?ref=app
0
AJ #Infinity Love How please give the syntax
0
AJ #Infinity Love Please modify my code and share it please
0
AJ #Infinity Love
The examiner will cut my answer as in the below line its given void inputArray() which will not take any parameters but here its taking Scanner object as parameter.
void inputArray(Scanner sc) {
for(int i = 0; i < n; i++) {
num[i] = sc.nextInt();
}
}
Update:The program is also not working properly.
0
SOUPTIK NATH Problem was in your logic. Now Check again.
0
AJ #Infinity Love Why SoloLearn is not 100% perfect?