public class VehicleTest { public static void main(String[] args) { // 1. 创建Vehicle数组,存放不同子类对象 Vehicle[] vehicles = { new Car(), new Bike(), new Truck() }; // 2. 遍历数组,调用每个对象的run()方法 System.out.println("\n=== 进阶题抽象类多态测试 ==="); for (Vehicle v : vehicles) { v.run(); } } }