Why not working in SoloLearn but working in Idea?
Why not working in SoloLearn but working in Idea? When I use this code I get :Exception in thread "main" java.util.NoSuchElementException: No line found at java.base/java.util.Scanner.nextLine(Scanner.java:1651) at AnimalCall.main(AnimalCall.java:12) but in Idea no problem with it import java.util.Scanner; public class AnimalCall { public static void main(String[] args) { System.out.println("Please enter animal type! Only the introduction optionare accepted: cow, dog, cat, mouse or c, d, ca, m"); Scanner sc = new Scanner(System.in); int check = 0; while(check >= 0) { String s = sc.nextLine(); if(s.equals("c") || s.equals("C") || s.equals("cow") || s.equals("Cow") || s.equals("COW")) { System.out.println("MMMMMMMOOOOOOWWWWWW!!!!!!!!"); break; } if(s.equals("d") || s.equals("D") || s.equals("dog") || s.equals("Dog") || s.equals("DOG")) { System.out.println("WOOOOOOFFFFFFF!!!!!!!!"); break; } if(s.equals("ca") || s.equals("Ca") || s.equals("CA") || s.equals("cat") || s.equals("Cat") || s.equals("CAT")) { System.out.println("MMMMMMMHHHEEEOOOOWWWW!!!!!!!!"); break; } if(s.equals("m") || s.equals("M") || s.equals("mouse") || s.equals("Mouse") || s.equals("MOUSE")) { System.out.println("SQWWWWIIIIRLLL!!!!!!!!"); break; } else { if(s.equals("stop") && check > 0) { break; } System.out.println("Please enter the type of animal correctly or write stop"); if(check > 100) { check = 1; } check++; } } } }