I am doing chapter 7 from the head first
Java book and I doing a sharpen your pencil question(179)
Instructions:
Put a check next to the relationships that make sense: I am using the is-a and then I going one step further by trying if it could be a has a.
Oven extends Kitchen - Oven is a Kitchen - does not work if it was Kitchen has a oven then that would mean oven is a instance variable of Kitchen?
Guitar extends instrument - Guitar is a instrument - makes sense so Guitar can inherate from instrument.
Person extends Employee - Person is a Employee - not sure about this one is sounds like it makes sense but not sure though but I guess sicne not every person is a employee it would not work.
Ferrari extends Engine - Ferrari is a Engine - does not make sense but ferrair has a Engine so Ferrari would be a instance variable of Engine?
FriedEgg extends Food - FriedEgg is a Food - makes sense so FriedEggy inherates from Food
Beagle extends Pet - Beagle is a pet - makes sense so Beagle inherates from Pet.
Container extends Jar - Container is a Jar - could make sense too since a Container could be a Jar.
Metal extends Titanium - metal is a Titanium - does not make sense so it does not work. Since not all metal is Titanium
GratefulDead extends Band - GratefulDead is a Band - it works
Blonde extends Smart - Blonde is a Smart - to me that does not make sense but according to the answers I found it works.
Beverage extends Martini - Beverage is a Martini -- this one to me could work too since martini could be classified as Beverage but then again not every beverage is a Martini.