栈与运算符类

/**
 * 栈
 * @author RuiLin.Xie - xKF24276
 */
class Shed
{
	ArrayList<String> list = new ArrayList<String>();
	
	//长度
	public int getSize()
	{
		return list.size();
	}
	
	//存
	public void put(String num)
	{
		list.add(num);
	}
	
	//取
	public String get()
	{
		String num = list.get(getSize() - 1);
		list.remove(num);
		return num;
	}
}

/**
 * 运算符
 * @author RuiLin.Xie - xKF24276
 */
class Operator
{
	public final static String ADD = "+";
	
	public final static String MINUS = "-";
	
	public final static String MULTIPLY = "*";
	
	public final static String DIVIDE = "/";
}

你可能感兴趣的:(运算符)