hab folgendes Programm geschrieben:
...es compiliert aber in bluej noch nicht....
Code:
public class Rechnermethode
{
/* Lies von der Tastatur und schreibe auf den Bildschirm*/
public static void einAus() throws IOException
{
String operand1, operand2;
String operator;
BufferedReader eingabe = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Operand1: ");
String operand1 = eingabe.readLine();
int a = Integer.parseInt(operand1);
System.out.println("Operator: ");
String operator = eingabe.readLine();
System.out.println("Operand2: ");
String operand2 = eingabe.readLine();
int b = Integer.parseInt(operand2);
if (operator.equals("+"))
System.out.println(operand1 + operand2);
if (operator.equals("-"))
System.out.println(operand1 - operand2);
if (operator.equals("*"))
System.out.println(operand1 * operand2);
if (operator.equals(":"))
System.out.println(operand1 : operand2);
}
}
...es compiliert aber in bluej noch nicht....