In: Computer Science
Write a Java program that reads two integers on the keyboard and displays them on the screen.
import java.util.Scanner;
public class showint {
public static void main(String[] args) {
// Creates a reader instance which takes
// input from standard input - keyboard
Scanner reader = new Scanner(System.in);
System.out.print("Enter a number: ");
// nextInt() reads the next integer from the keyboard
int number = reader.nextInt();
System.out.print("Enter second number: ");
int number2 = reader.nextInt();
// println() prints the following line to the output screen
System.out.println("You entered: " + number + " and " + number2);
}
}