给float参数或Double型参数赋值为0 ,但初始化仍然是0.0;我想问一下,如何让参数初始化为0 呢?private float oneNumber = 0 ;private Double twoNumber = 0.0 ;public float getOneNumber() { return oneNumber;}public void setOneNumber(float oneNumber) { this.oneNumber = oneNumber;}public Double getTwoNumber() { return twoNumber;}public void setTwoNumber(Double twoNumber) { this.twoNumber = twoNumber;}他们的get方法返回0.0,我怎么可以让它等于0.0时,赋值为0??
添加回答
举报
0/150
提交
取消