⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 autoshowtester.java

📁 Java array and inheritance examples
💻 JAVA
字号:
public class AutoshowTester { 
public static void main(String args[]) {
    Autoshow  anAutoshow = new Autoshow(); 
    //First add lotsa cars to the show
    anAutoshow.addCar(new Car("959", "Porsche", "red", 340));
    anAutoshow.addCar(new Car("Grand-Am", "Pontiac", "White", 160));
    anAutoshow.addCar(new Car("Mustang", "Ford", "White", 230));
    anAutoshow.addCar(new Car("Rabbit", "Volkswagon", "Blue", 100));
    anAutoshow.addCar(new Car("Jetta", "Volkswagon", "Silver", 130));
    anAutoshow.addCar(new Car("Storm", "Geo", "Yellow", 140));
    anAutoshow.addCar(new Car("MR2", "Toyota", "Black", 210));
    anAutoshow.addCar(new Car("Escort", "Ford", "Yellow", 10));
    anAutoshow.addCar(new Car("Civic", "Honda", "Black", 180));
    anAutoshow.addCar(new Car("Altima", "Nissan", "Silver", 190));
    anAutoshow.addCar(new Car("525", "BMW", "Gold", 490));
    anAutoshow.addCar(new Car("Prelude", "Honda", "White", 90));
    anAutoshow.addCar(new Car("RX7", "Mazda", "Red", 220));
    anAutoshow.addCar(new Car("MX6", "Mazda", "Green", 180));
    anAutoshow.addCar(new Car("Firebird", "Pontiac", "Black", 140));

    //Now test our fun methods
    System.out.println(anAutoshow);
    System.out.println("\nHere are the Pontiac cars:");
    System.out.println(anAutoshow.carsWithMake("Pontiac"));
    System.out.println("Here are the Ford cars:");
    System.out.println(anAutoshow.carsWithMake("Ford"));
    System.out.println("\nHere are the different makes:");
    System.out.println(anAutoshow.differentMakes());
    System.out.println("\nThis is the fastest car:");
    System.out.println(anAutoshow.fastestCar());
    System.out.println("\nThe most common color is " +
        anAutoshow.mostCommonColor());
    System.out.println("\nHere are the cars sorted by top speed:");
    anAutoshow.printBySpeed();
    System.out.println("\nHere are the cars sorted by make:");
    anAutoshow.printByMake();
}

} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -