【发布时间】:2019-03-17 20:46:42
【问题描述】:
每当为我的双精度输入一个 int 时,我都会尝试打印出一个 int。例如用户输入 123456,输出 123456;用户输入 1.0,输出 1.0。到目前为止,我的代码无论如何都会打印一个双精度。这是我的 fullCellText 方法。
我的代码:
package textExcel;
public class ValueCell extends RealCell {
private boolean isInt;
public ValueCell(String cell) {
super(cell);
// TODO Auto-generated constructor stub
}
public ValueCell(String cell, boolean isInt) {
super(cell);
this.isInt = isInt;
// TODO Auto-generated constructor stub
}
public String fullCellText() {
return "" + cell;
}
}
【问题讨论】: