Java Reference
In-Depth Information
Which of the following statements is true?
a. All objects created from the same class must be identical.
b. All objects created from the same class can be different from each other.
c. An object inherits attributes and behavior from the class used to create it.
d. A class inherits attributes and behavior from its subclass.
1
The answer is available on the topic's website at http://www.java21days.com. Visit the
Day 1 page and click the Certification Practice link.
Exercises
To extend your knowledge of the subjects covered today, try the following exercises:
1. In the main() method of the VolcanoRobot class, create a second VolcanoRobot
robot named virgil , set up its instance variables, and display them.
2. Create an inheritance hierarchy for the pieces of a chess set. Decide where the
instance variables color , startingPosition , forwardMovement , and
sideMovement should be defined in the hierarchy.
Where applicable, exercise solutions are offered on the topic's website at http://www.
java21days.com.
 
Search WWH ::




Custom Search