Solved

Why Is the Following Code, Which Assumes ChoiceQuestion Is a Subclass

Question 81

Multiple Choice

Why is the following code, which assumes ChoiceQuestion is a subclass of Question, considered poor strategy? Why is the following code, which assumes ChoiceQuestion is a subclass of Question, considered poor strategy?    A) Question should be the subclass, not the other way around. B) instanceof is not an operator but rather a method. C) instanceof should not be used for type tests that can be solved by using polymorphism. D) the instanceof reserved word should only be used in a class constructor.


A) Question should be the subclass, not the other way around.
B) instanceof is not an operator but rather a method.
C) instanceof should not be used for type tests that can be solved by using polymorphism.
D) the instanceof reserved word should only be used in a class constructor.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents