What Scanner method reads an integer value from the user? code example
Example 1: scanner methods java char
Scanner scanner = new Scanner(System.in);
char ch = scanner.next().charAt(0);
Example 2: how to scan Integer in Java
import java.util.*;
public class HowToScan {
public static void main( String args[] )
{
Scanner S = new Scanner(System.in);
int a;
int b;
int sum;
a = S.nextInt();
b = S.nextInt();
sum = a + b;
System.out.println( a + "+" + b + "=" + sum );
}
}