package _04_多态运行特点.demo2;

public class Test {
    // bike
    public static void useVehicle(Vehicle vehicle){
        // 成员变量  多态编译看左边运行看左边,  只能够打印父类明成无法打印子类的名称
        System.out.println("交通工具名称"+ vehicle.name);
        vehicle.run();
    }

    public static void main(String[] args) {
        Vehicle vehicle = new Bike();
        useVehicle(vehicle);

        useVehicle(new Car());
    }
}
