class Car extends Vehicle implements java.io.Serializable
Constructor and Description |
---|
Car(java.lang.String vin,
java.lang.String make,
java.lang.String model,
int year,
double price,
int mileage,
java.lang.String bodyStyle)
This is the regular constructor, that is, the one that is
expected to be invoked.
|
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.String |
getBodyStyle() |
(package private) void |
setBodyStyle(java.lang.String bodyStyle) |
java.lang.String |
toString()
This method just adds the body style to the default vehicle string.
|
static boolean |
validateBodyStyle(java.lang.String bodyStyle)
Currently, this only checks to make sure the body style is not an empty
string.
|
getMake, getModel, getPrice, getVin, getYear, validateMake, validateModel, validatePrice, validateVin, validateYear
public Car(java.lang.String vin, java.lang.String make, java.lang.String model, int year, double price, int mileage, java.lang.String bodyStyle)
vin
- The vin number of the new carmake
- The make of the new carmodel
- The model of the new caryear
- The year of the new carprice
- The price of the new carpublic static boolean validateBodyStyle(java.lang.String bodyStyle)
bodyStyle
- the proposed body style of the carpublic java.lang.String toString()
java.lang.String getBodyStyle()
void setBodyStyle(java.lang.String bodyStyle)