showTotal()方法中补齐代码:
this.total=Double.valueOf(this.price) * Double.valueOf(this.num)
定义一个测试类,在main方法中创建Product对象,并调用它的showTotal()方法:
public class Test {
public static void main(String[] args) {
Product product =new Product("apple","2","100");
product.showTotal();
}
}