package _01_对象数组;

import java.util.Scanner;

public class CarTest {
    public static void main(String[] args) {
        Car[] cars = new Car[3];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < cars.length; i++) {
            System.out.println("请录入品牌");
            String brand = scanner.next();
            System.out.println("请录入价格");
            double price  = scanner.nextDouble();
            System.out.println("请录入颜色");
            String color = scanner.next();
            Car car = new Car(brand,color,price);
            cars[i] = car;
        }

        // 打印数组看俩面元素内容
        for (Car car : cars) {
            System.out.println(car);
        }
    }
}
