Class 1, Part 2 | Intro to Java 30-IT-396 |
Objects and Classes
private String make;
private String model;
private Color color;
private int year;
private Date timestamp;
private static int inventoryNumber;
private int thisInventoryNumber;
public Car() {
make = "Chevrolet";
model = "Cavalier";
Color = new Color(Color.black);
year = 2000;
}
public Car(String make, String model, Color color,
int year){
this.make = make;
this.model = model;
this.color = color;
this.year = year;
}
{
timestamp = new Date();
thisInventoryNumber
= inventoryNumber;
}
static {
inventoryNumber = inventoryNumber++;
}
}
Created by: Brandan
Jones January 4, 2002