/************************************************************************ * * * EXAMPLE CLASS * * * * This class stores information about a car. * * * * Author: Brian Bargh * * * * Date: 7/20/06 * * * ************************************************************************/ public class Car{ private int year; private String model; //Constructor public Car(int yearIn, String modelIn){ setYear(yearIn); //Calling the setYear method setModel(modelIn); //Calling the setModel method } //Sets the value of year public void setYear(int yearIn){ year=yearIn; } //Sets the value of model public void setModel(String modelIn){ model=modelIn; } //Returns the value of year public int getYear(){ return year; } //Returns the value of model public String getModel(){ return model; } //Prints out information about the class public void print(){ System.out.println("This car is a " + year + " " + model + "."); } }