Sir this code is working fine in ide but throwing Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at sortedArray.main(sortedArray.java:14)
Regarding sorted array challenge
the teme activated here is dark , I get problem in even recognizing cursor, its default or can be changed in any way
There’s problem with your input methods. Understand the difference between various scanner input methods:-
nextInt() takes the input till the next space.
nextLine() takes the entire line as input.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.