CIS 212 Test 2 - Polymorphism

7 Questions  I  By Xenonii
Please take the quiz to rate it.

Professional Certification Quizzes & Trivia
A quick test on Polymorphism for CIS 212

  
or Create Online Exam
Changes are done, please start the quiz.


Questions and Answers

Removing question excerpt is a premium feature

Upgrade and get a lot more done!
  • 1. 
    What is the actual type of an object?
    • A. 

      The super class of the object

    • B. 

      The concrete class used to create the object

    • C. 

      The abstract class of an object

    • D. 

      The inheritance hierarchy of the object


  • 2. 
    What is the apparent type of an object?
    • A. 

      The type of the expression that uses the object

    • B. 

      The result of the toString() method

    • C. 

      The subtype of the object

    • D. 

      The class used to instantiate the object


  • 3. 
    An apparent type is always...
    • A. 

      A subtype of the actual type

    • B. 

      The same for each instance

    • C. 

      A supertype of the actual type

    • D. 

      None of the above


  • 4. 
    When using an object, the interface is defined by the
    • A. 

      Apparent type

    • B. 

      Actual type

    • C. 

      None of the above


  • 5. 
    When using an object, the behaviour is defined by the
    • A. 

      Apparent type

    • B. 

      Actual type

    • C. 

      None of the above


  • 6. 
    Substitution principle means that
    • A. 

      We can swap an instance of some type with some other instance of the same type

    • B. 

      Subtype can be used wherever a supertype is expected without affecting correctness of client code

    • C. 

      Supertype can be used wherever a subtype is expected without affecting correctness of client code

    • D. 

      We can override a method easily

    • E. 

      None of the above


  • 7. 
    When creating a subtype, Java cannot enforce some specification declared in some supertype. So in order for the subtype to be compliant with the spec, it should
    • A. 

      Implement all methods of the supertype

    • B. 

      Satisfy the postconditions and preconditions found in the spec

    • C. 

      Inherit by specification

    • D. 

      None of the above


Back to top

Removing ad is a premium feature

Upgrade and get a lot more done!
Take Another Quiz
We have sent an email with your new password.