001package composite.one; 002public class Main { 003 public static void main(String[] args) { 004 Expr one = new Const(1); 005 Expr onePtwo = new Plus (new Const(1), new Const(2)); 006 Expr threeMfour = new Mult (new Const(3), new Const(4)); 007 Expr m = new Minus (onePtwo, threeMfour); 008 Expr n = new Quot (m, new Const(5)); 009 010 System.out.println(n); 011 System.out.println("Value: " + n.eval()); 012 } 013}