1234567891011121314151617181920212223242526272829 |
- package J20250724.demo01;
- /**
- * @author WanJl
- * @version 1.0
- * @title Clothing
- * @description
- * @create 2025/7/24
- */
- public class Clothing extends Product{
- private Integer size;
- public Integer getSize() {
- return size;
- }
- public void setSize(Integer size) {
- this.size = size;
- }
- @Override
- public double getDiscountPrice() throws InvalidPriceException{
- Double price = this.getPrice();
- if (price<=0){
- throw new InvalidPriceException("价格异常");
- }
- return 0;
- }
- }
|