Hello I am fairly new to java and I have a problem with entering long numbers
So my code is
import java.util.*;
public class Test {
public static void main(String []args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter int: ");
int a = scan.nextInt();
}
}
and my output is
Enter int:
12312312312
Exception in thread "main" java.util.InputMismatchException: For input string: "12312312312"
at java.util.Scanner.nextInt(Unknown Source)
at java.util.Scanner.nextInt(Unknown Source)
at Test.main(Test.java:6)
can you help me with this problem