Character-based Input (Applications only)
import java.io.*;
/**
* ReadIn is an application to demonstrate reading input.
*
* @author Your Name
*/
public class ReadIn
{
public static void main (String args[]) throws IOException
{
BufferedReader keyboard =
new BufferedReader(new InputStreamReader(System.in));
String str = "";
int num1;
int num2;
System.out.print("Enter a number: ");
str = keyboard.readLine();
num1 = Integer.parseInt(str);
str = keyboard.readLine();
num2 = Integer.parseInt(str);
System.out.println(num1 + " + " + num2 + " is " + (num1 + num2));
}
}