java面向对象的基础问题

JAVA代码遇到问题
我创建三个私有变量,用get和set给变量赋值和输出
在测试类里创建三个变量赋值,然后打印价格的总和,不知道哪里出错了,打印颜色1和品牌没问题

public class a6 {
    private String brand;
    private int price;
    private String color;
    public a6(){}
    public a6(String brand,int pricr,String color){
    this.brand = brand;
    this.color = color;
    this.pricr = pricr;
    }
    public void setBrand(String brand){
        this.brand = brand;
    }
    public String getBrand(){
        return brand;
    }
    public void setPrice(int price){
        this.price = price;
    }
    public int getPrice(){
        return price;
    }
    public void setColor(String color){
        this.color = color;
    }
    public String getColor(){
        return color;
    }
}

下面是测试类

public class a6Test {
    public static void main(String[] args) {
        a6[] arr = new a6[3];
        a6 s1 = new a6("小米",1999,"黑色");
        a6 s2 = new a6("华为",5999,"红色");
        a6 s3 = new a6("苹果",3999,"绿色");
        arr[0] = s1;
        arr[1] = s2;
        arr[2] = s3;
        int sum = 0;
        for(int i = 0;i < arr.length;i++){
            sum = sum + arr[i].getPrice();
        }
        System.out.println(sum);
    }
}

img

你这变量名贴错了吧

img

img

this.pricr = pricr;
->
this.price = pricr;