java int inputting function code example
Example 1: input java
Scanner in = new Scanner(System.in);
System.out.print("Please enter hour 1: ");
int hour1 = in.nextInt();
System.out.print("Please enter hour 2: ");
int hour2 = in.nextInt();
System.out.print("Please enter minute 1: ");
int min1 = in.nextInt();
System.out.print("Please enter minute 2: ");
int min2 = in.nextInt();
Example 2: read integer input java
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(br.readLine());