Chapter 10: OOP Polymorphism

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:26 PM on 5/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

16 Terms

1
New cards

10.1 Q1: Polymorphism enables you to

program in the general

2
New cards

10.2 Q1: For which of the following would polymorphism not provide a clean

solution?

A program to compute a 5% savings account interest for a variety of clients.

3
New cards

10.2 Q2: Polymorphism allows for specifics to be dealt with during:

execution

4
New cards

Which statement best describes the relationship between superclass and subclass types?

A subclass reference can be assigned to a superclass variable, but a superclass reference cannot be assigned to a subclass variable.

5
New cards

10.4 Q1: A(n) _______ class cannot be instantiated

abstract

6
New cards

10.4 Q2: Non-abstract classes are called ________.

concrete classes

7
New cards

10.5 Q1: It is a UML convention to denote the name of an abstract class in ________

italics

8
New cards

10.5 Q2: If the superclass contains only abstract method declarations, the superclass is used for ________

interface inheritance

9
New cards

10.5.1 Q1: Which of the following could be used to declare abstract method method1 in abstract class Class1 (method1 returns an int and takes no arguments)?

public abstract int method1();

10
New cards

10.5.1 Q2: Which of the following statements about abstract superclasses is true?

abstract superclasses may contain data.

11
New cards

10.5.2 Q1: Consider the abstract superclass below:

public abstract class Foo {

private int a;

public int b;

public Foo(int aVal, int bVal) {

a = aVal;

b = bVal;

}

public abstract int calculate();

}

Any concrete subclass that extends class Foo:

Both (a) and (b).

12
New cards

0.5.5 Q1: Consider classes A, B and C, where A is an abstract superclass, B is a concrete class that inherits from A and C is a concrete class that inherits from B. Class A declares abstract method originalMethod, implemented in class B. Which of the following statements is true of class C?

None of the above.

13
New cards

10.5.6 Q1: When a superclass variable refers to a subclass object and a method is called on that object, the proper implementation is determined at execution time. What is the process of determining the correct method to call?

late binding (also called dynamic binding)

14
New cards

10.5.6 Q2: Every object in Java knows its own class and can access this information through method _______

getClass

15
New cards

10.6 Q1: Assigning a subclass reference to a superclass variable is safe ________

because the subclass object is an object of its superclass.

16
New cards

10.7 Q1: Classes and methods are declared final for all but the following reasons

final methods are static.