1
2
3
4
5
6
7
8public
9class UnaryPlus extends UnaryExpr {
10
11
12
13 public
14 UnaryPlus(Expr operand) {
15 super(operand);
16 }
17
18
19
20
21
22
23 public
24 Object eval() {
25 return
26 operand.eval();
27 }
28
29
30
31 public
32 String toString() {
33 return
34 "( +" + operand.toString() + ")";
35 }
36}
37
38
39