Scanner s = new Scanner(System.in);

int value = s.nextInt();

Scanner (Java Platform SE 7 )