//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** @author Casey Bowman * @version 1.1 * @date Sat Feb 28 10:54:55 EST 2015 * @see LICENSE (MIT style license file). */ public class Truck { private String make; private String model; private String year; // A year is a number, but will likely not require any math, therefore can be stored as a String //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Constructor for Truck class * @param ma The make of the truck * @param mo The model of the truck * @param ye The year the truck was made */ public Truck (String ma, String mo, String ye) { make = ma; model = mo; year = ye; } // Truck constructor //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // Getters public String getMake () { return make; } public String getModel () { return model; } public String getYear () { return year; } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // Setters public void setMake (String ma) { make = ma; } public void setModel (String mo) { model = mo; } public void setYear (String ye) { year = ye; } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // toString @Override public String toString () { return "Truck (Make = " + make + ", Model = " + model + ", Year = " + year + ")"; } //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** Main method. * Creates a new instance of the Truck class with * the given make, model, and year, then prints the * Truck to the command line using the Truck's toString * method. */ public static void main (String[] args) { Truck t = new Truck ("Chevrolet", "Silverado", "2010"); System.out.println (t); } // main } // Truck