001package composite.three; 002public class Main { 003 public static void main(String[] args) { 004 Expr one = ExprFactory.newConst(1); 005 Expr onePtwo = ExprFactory.newPlus 006 (ExprFactory.newConst(1), ExprFactory.newConst(2)); 007 Expr threeMfour = ExprFactory.newMult 008 (ExprFactory.newConst(3), ExprFactory.newConst(4)); 009 Expr m = ExprFactory.newMinus (onePtwo, threeMfour); 010 Expr n = ExprFactory.newQuot (m, ExprFactory.newConst(5)); 011 012 System.out.println(n); 013 System.out.println("Value: " + n.eval()); 014 } 015}