blob: b460fd020d2803133e6ae33990d613672b5293a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package net.sven_eisenhauer.swa_prakt1;
public abstract class ArithmeticOperator implements ArithmeticExpression{
protected ArithmeticExpression operand1;
protected ArithmeticExpression operand2;
protected String operandSign;
public ArithmeticOperator(ArithmeticExpression operand1
,ArithmeticExpression operand2){
this.operand1 = operand1;
this.operand2 = operand2;
}
@Override
public void print() {
System.out.print("(");
operand1.print();
System.out.print(operandSign);
operand2.print();
System.out.print(")");
}
}
|