What must a subclass do to modify a private superclass instance variable?
A) The subclass must simply use the name of the superclass instance variable.
B) The subclass must declare its own instance variable with the same name as the superclass instance variable.
C) The subclass must use a public method of the superclass (if it exists) to update the superclass's private instance variable.
D) The subclass must have its own public method to update the superclass's private instance variable.
Correct Answer:
Verified
Q17: Consider the classes shown below:
Q18: Consider the classes shown below:
Q19: Consider the hierarchy of classes shown below.
Q20: Insert the missing code in the following
Q21: You are creating a Motorcycle class which
Q23: Consider the following code snippet:
Q24: Consider the following class hierarchy:
Q25: Consider the following class hierarchy:
Q26: Which of the following is true regarding
Q27: Which reserved word must be used to
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