Q:

What's wrong with my Scanner java code? 

import java.util. Scanner;  

public class Exercise5 {  

 public static void main(String[] args) {  
  Scanner in = new Scanner(System.in);  

  System.out.print("Input first number: ");  
  int num1 = in.nextInt(5);  

  System.out.print("Input second number: ");  
  int num2 = in.nextInt(25);  

  System.out.println(num1 + " x " + num2 + " = " + num1 * num2);  
 }  

}  

**Here is my java code, the expect output should be like this:
Input first number: 25
Input second number: 5
25 x 5 = 125
After I plug in my code and run it, the output is too different with the answer
Here is the output:
Input first number: 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 Exercise5.main(Exercise5.java:27)

How can I fix my code? 

A:

"5" in in.nextInt(5); means radix.  Do you need it?  Does the program work if you use nextInt() method with no parameters? 
Also, for some reason both of versions work for me with no error:
// output of nextInt(radix) version
java Excercise5
Input first number: 32
Input second number: 23
17 x 53 = 901

// output of nextInt() version
java Excercise5
Input first number: 5
Input second number: 25
5 x 25 = 125

