Shopping Cart problem

1. The issue of num parameter passing

In order price should not be set in;

把 public String getsum(Order o) {
  
  double sum=o.g.price*o.num;
  String sum1 = new DecimalFormat("#.##").format(sum);
  return sum1;
 }

Written in the Cart class to solve the problem, because the real value of num is after the call returns in the Cart in Cart

Guess you like

Origin www.cnblogs.com/zlshy/p/11703329.html