May be the following will shed some light:




import java.util.Scanner;

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