/************************************************************************ * * * EXAMPLE CLASS * * * * This class will create an instance of the Car class and call some of * * its methods. * * * * Author: Brian Bargh * * * * Date: 7/20/06 * * * ************************************************************************/ // This is the class declaration; it says that this is a class called // CarMain. It is required at the beginning of every class. The name // of the class must be the same as the name of the file, excluding the .java. public class CarMain{ //This is the main method declaration. In order to be able to run //a class there must be a main method that is declared exactly the //same way. public static void main( String[] args ){ int year; //declaring an integer called year. String model; //declaring a String called model. Car car1; System.out.println("This program stores information about a car."); //Getting user input and storing it in year. year = Console.readInt("Enter the year of the vehicle: "); //Getting user input and storing it in model. model = Console.readString("Enter the model of the vehicle: "); car1 = new Car(year, model); //Creating car1 car1.print(); } //end of main method } // end of class