Subject: Winner: 1k survey | Home Depot

From: Home Depot <[email-masked]>
Date: Mon, 28 Jul 2014 07:28:15 -0700

The Home Depot

Your Store #5543

Congrats, Survey Winner! You qualify for a $1,000 Home Depot Card.

claim now >

Survey-ID: 27760201

The Home Depot is in the home improvement business and our goal is to provide the highest level of service, the broadest selection of products and the most competitive-prices.

Tool & Truck Rental | Survey Winners | Installation Services and Repair | Help

The Boat class may have an other definition for getPriceAfterYears and specific attributes and methods.

what do I really have in my garage? I'm trying to get the intuition as well as understand what's going on "behind the scenes".

This message was not sent from the company stated above. this is a 3rd party message
that was sent to you via HDT Networks 6832 NW 60th Street | Ocala | FL | 34482 you can exit future messages h e r e

You garage contains Vehicles, so the compiler static control view that you have a Vehicle and as .auto is a Car field you can't access it, dynamically it is a Car

It would be even better to have a three-valued EngineType enum (HAS_NO_GEARS, HAS_GEARS_AUTO_SHIFT, HAS_GEARS_MANUAL_SHIFT), which would let your code reason on the actual characteristics of a generic Vehicle cleanly and accurately. (You'd need this distinction to handle motorbikes, anyway.)

A garage might want to know about a vehicle's transmission if it may need to rearrange vehicles and various vehicles may always, never, or sometimes

So now back in the Garage class, you can define:So now back in the Garage class, you can define:

// car specific
public int numberOfAutomaticCars() {
int s = 0;
for(Car car : cars) {
if(car.isAutomatic()) {
s++;
}
}
return s;
}