When identifying the proper instance variables to use in the design of an inheritance hierarchy, how do you decide where in the hierarchy a variable should be placed?
A) Instance variables should only be declared in the superclass and then accessed using the super keyword.
B) Instance variables should only be declared in subclasses.
C) Instance variables that are common to all classes should be placed at the base of the hierarchy.
D) Instance variables that are relevant to only one class should be placed at the base of the hierarchy.
Correct Answer:
Verified
Q83: When you implement equals in a subclass,
Q84: Consider the following code snippet:
Q85: Consider the Counter class below.
Q86: Consider the following code snippet, which is
Q87: Consider the following code snippet:
Q89: Consider the following code snippet:
Q90: Consider the following code snippet:
Q91: Consider the Counter class below.
Q92: Consider the following code snippet: Q93: Consider the following code snippet:
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents