package com.hanqi;
public class shuiGuo {
private String color;
private double price;
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
private double weight;
}
}
private double weight;
}
public class fruit {
public static void main(String[] args) {
shuiGuo apple=new shuiGuo();
apple.setColor("红色");
apple.setPrice(5.5);
apple.setWeight(10);
System.out.println(apple.getColor());
System.out.println(apple.getWeight());
System.out.println(apple.getPrice());
}
}