package lianxi1;
class Phone{
private String brand;
private int price;
private String color;
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
public class shouji {
public static void main(String[] args) {
Phone p = new Phone();
p.setBrand("小米") ;
p.setColor("红色");
p.setPrice(2999);
System.out.println(p.getBrand()+"----"+p.getColor()+"----"+p.getPrice());
}
}
class Phone{
private String brand;
private int price;
private String color;
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}
public class shouji {
public static void main(String[] args) {
Phone p = new Phone();
p.setBrand("小米") ;
p.setColor("红色");
p.setPrice(2999);
System.out.println(p.getBrand()+"----"+p.getColor()+"----"+p.getPrice());
}
}