1/15
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
10.1 Q1: Polymorphism enables you to
program in the general
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.
10.2 Q2: Polymorphism allows for specifics to be dealt with during:
execution
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.
10.4 Q1: A(n) _______ class cannot be instantiated
abstract
10.4 Q2: Non-abstract classes are called ________.
concrete classes
10.5 Q1: It is a UML convention to denote the name of an abstract class in ________
italics
10.5 Q2: If the superclass contains only abstract method declarations, the superclass is used for ________
interface inheritance
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.5.1 Q2: Which of the following statements about abstract superclasses is true?
abstract superclasses may contain data.
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).
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.
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)
10.5.6 Q2: Every object in Java knows its own class and can access this information through method _______
getClass
10.6 Q1: Assigning a subclass reference to a superclass variable is safe ________
because the subclass object is an object of its superclass.
10.7 Q1: Classes and methods are declared final for all but the following reasons
final methods are static.