| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package _01_对象数组;
- public class Car {
- private String brand;
- private String color;
- private double price;
- public Car() {
- }
- public Car(String brand, String color, double price) {
- this.brand = brand;
- this.color = color;
- this.price = price;
- }
- /**
- * 获取
- * @return brand
- */
- public String getBrand() {
- return brand;
- }
- /**
- * 设置
- * @param brand
- */
- public void setBrand(String brand) {
- this.brand = brand;
- }
- /**
- * 获取
- * @return color
- */
- public String getColor() {
- return color;
- }
- /**
- * 设置
- * @param color
- */
- public void setColor(String color) {
- this.color = color;
- }
- /**
- * 获取
- * @return price
- */
- public double getPrice() {
- return price;
- }
- /**
- * 设置
- * @param price
- */
- public void setPrice(double price) {
- this.price = price;
- }
- public String toString() {
- return "Car{brand = " + brand + ", color = " + color + ", price = " + price + "}";
- }
- }
|