【好調】Java の宿題ここで答えます【三巡目】
■ このスレッドは過去ログ倉庫に格納されています
0087>>81 その4
NGNGstatic ChoiceFormat fmt = new ChoiceFormat("4#演算子|5#単項演算子|7#定数|8#右括弧|9#左括弧|"
+ "10#変数|11#演算子|12#(終)|13#(不正トークン)");
String sign;
int type;
public Token(int type, String sign){
this.type = type;
this.sign = sign;
}
public int getType(){
return type;
}
public double getValue() {
return Double.parseDouble(sign);
}
public String toString(){
return fmt.format(type) + " : " + sign;
}
}
■ このスレッドは過去ログ倉庫に格納されています