• Card 65 / 76: What are the design benefits of using polymorphism? (Choose all that apply.)
    A) Objects can be generalized as return types and method parameters.
    B) Less code needs to be written.
    C) Superclasses and subclasses can be used interchangeably.
    D) Polymorphism allows code to work with many different types of classes that all share some commonality, such as implementing the same interface.

    Answer:
    A) Objects can be generalized as return types and method parameters.
    D) Polymorphism allows code to work with many different types of classes that all share some commonality, such as implementing the same interface.

  • Keyboard Shortcuts

    Previous Card ← Previous Card Button
    Next Card → Next Card Button
    Flip Card Space-Bar
<< First < Previous Next > Last >>

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now
Explanation:

A and D.

A is correct because polymorphism allows objects to act as other objects. The other objects are more general forms of the original object.

D is correct because polymorphism also allows different classes that share some common functionality to be treated the same. They must all implement the same interface.

B and C are incorrect.

B is incorrect because less code may be required, but this is not always the case.

C is incorrect because objects can be referenced only in their more general form. An object cannot be used as a more specific object that extends it later.

Hide Choices Interactive Question Exam Home Page
https://www.jobilize.com/quiz-my-oca-mock-exam-by-mike-wolf

My OCA Mock

Author:

Access: Public Instant Grading

Flash Cards plugin by Curtis Blackwell github.com/curtisblackwell/flash_cards
Google Play and the Google Play logo are trademarks of Google Inc.
Ask
Anonymous User
Start Quiz
Subramanian Divya
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/quiz-my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>