import java.io.*;
public class BufferedDemo
{
public static void main(String args[])
{
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter first number: ");
String n1 = br.readLine();
System.out.print("Enter second number: ");
String n2 = br.readLine();
//convert string into integer
int a = Integer.parseInt(n1);
int b = Integer.parseInt(n2);
int sum = a + b;
System.out.println("Result: "+sum);
}
catch(NumberFormatException nfe)
{
System.out.println("Enter only integer value");
}
catch(IOException io)
{
io.printStackTrace();
}
}
}