Inheritance Make up Test
By Mickey Arnold
starstarstarstarstarstarstarstarstarstar
Last updated 10 months ago
1 Question
100 points
100
Question 1
1.
Directions :: Extend class Monster to make a Vampire. A Vampire is a Monster. A Vampire has all of the properties and behaviors of a Monster and it has additional properties of strength and age. Strength is of type double and stores the strength and age is of type int and stores the age.
You must provide 4 constructors for class Vampire.One constructor must be a default.One constructor must be a name only constructor.One constructor must be a strength and age only constructor.One constructor must be a name, strength, and age constructor.
You must provide a toString( ) method.
Directions :: Extend class Monster to make a Vampire. A Vampire is a Monster. A Vampire has all of the properties and behaviors of a Monster and it has additional properties of strength and age. Strength is of type double and stores the strength and age is of type int and stores the age.
You must provide 4 constructors for class Vampire.
One constructor must be a default.
One constructor must be a name only constructor.
One constructor must be a strength and age only constructor.
One constructor must be a name, strength, and age constructor.
You must provide a toString( ) method.