设计模式composite计算器


package composite;public class Number implements Element{private double num;public Number(double num){this.num=num;}public double getValue(){return num;}}
 

package composite;interface Element { double getValue();}
 

你可能感兴趣的:(设计模式)