java util scanner file code example Example: scanner java Scanner sc = new Scanner(System.in); int i = sc.nextInt();