Class Expression-Tính biểu thức

[sourcecode language=”java”]

/**
* Author: Lai The Anh
* Class: K52CC
* Student code: 07020009
* Purpose: Cacutate Expression
*/
import java.util.*;
import java.lang.*;
public class Expression {
private String as_Expression = “”;
public Expression(int _value){
as_Expression += Integer.toString(_value);
}
public Expression(char _value){
as_Expression += Character.toString(_value);
}
public Expression append(char _sign, int _value){
as_Expression += Character.toString(_sign);
as_Expression += Integer.toString(_value);
return this;
}
public Expression append(char _sign, char _value){
as_Expression += Character.toString(_sign);
as_Expression += Character.toString(_value);
return this;
}//

Continue reading

© 2010-2013 As247 Blog. All Rights Reserved. 0,172