public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
System.out.println(a);
}
}
I get the following message and don't know why.
Exception in thread "main" java.util.InputMismatchException: For input string: "999999999999999"
at java.util.Scanner.nextInt(Scanner.java:2123)
at java.util.Scanner.nextInt(Scanner.java:2076)
at codingexercises.Main.main(Main.java:9)
I want to know how to fix the problem.