if this is a console app, you can read input from the console using this:
Code:
InputStreamReader ins = new InputStreamReader (System.in);
BufferedReader input = new BufferedReader (ins);
String strInput = "";
int i, j;
//this will get the input
try
{
strInput = input.readLine();
//check for valid operand here
//to get input for integers using strInput = input.readLine and parsing
//an integer using Integer.parseInt (strInput);
try
{
//get integers here using Integer.parseInt
}
catch (Exception e)
{
System.out.println ("ParseInt error. You didn't enter an integer");
}
}
catch (IOException e)
{
e.printStackTrace ();
}
from here you can reuse strInput for getting the operation, the first integer, and the second integer. you can use Integer.parseInt (strInput); to try to parse an integer.