标签:nbsp 调用 ble gets return string art car ret
1.关于num传参的问题
不应在order里设置price;
把 public String getsum(Order o) {
double sum=o.g.price*o.num;
String sum1 = new DecimalFormat("#.##").format(sum);
return sum1;
}
写在Cart类中就解决了问题,因为num真正的值是在Cart调用后返回在了Cart中
标签:nbsp 调用 ble gets return string art car ret
原文地址:https://www.cnblogs.com/zlshy/p/11703329.html