Exam 9: Inheritance

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

When a subclass overrides a superclass method, only the subclass's version of the method can be called with a subclass object.

(True/False)
4.8/5
(43)

When an "is a" relationship exists between objects, it means that the specialized object has all the characteristics of the general object plus additional characteristics that make it special.

(True/False)
4.7/5
(38)

In a UML diagram you show a realization relationship by connecting a class and an interface with a

(Multiple Choice)
4.9/5
(38)

Because the subclass is more specialized than the superclass, it is sometimes necessary for the subclass to replace inadequate superclass methods with more suitable ones.

(True/False)
4.8/5
(33)

A protected member of a class may be directly accessed by

(Multiple Choice)
4.9/5
(35)

When a class contains an abstract method, you cannot create an instance of the class.

(True/False)
4.8/5
(40)

A class becomes abstract when you place the __________ key word in the class definition.

(Multiple Choice)
4.8/5
(36)

If a method in a subclass has the same signature as a method in the superclass, the subclass method overrides the superclass method.

(True/False)
4.8/5
(35)

All methods specified by an interface are

(Multiple Choice)
4.8/5
(34)

A subclass can directly access

(Multiple Choice)
4.8/5
(43)

Which of the following statements correctly specifies two interfaces?

(Multiple Choice)
4.8/5
(29)

In __________, inheritance is shown with a line that has an open arrowhead at one end that points to the superclass.

(Multiple Choice)
4.8/5
(37)

Which of the following statements declares Salaried as a subclass of PayType?

(Multiple Choice)
5.0/5
(35)

In Java, a reference variable is __________ because it can reference objects of types different from its own, as long as those types are related to its type through inheritance.

(Multiple Choice)
4.8/5
(40)

In object-oriented programming, __________ allows you to extend the capabilities of a class by creating another class that is a specialized version of it.

(Multiple Choice)
4.8/5
(42)

What type of relationship exists between two objects when one object is a specialized version of another object?

(Multiple Choice)
4.7/5
(28)

A(n) __________ method is a method that appears in a superclass but expects to be overridden in a subclass.

(Multiple Choice)
4.7/5
(39)

In the following statement, which is the superclass? public class ClassA extends ClassB implements ClassC

(Multiple Choice)
4.9/5
(33)

Which key word indicates that a class inherits from another class?

(Multiple Choice)
4.8/5
(40)

When a method is declared with the __________ modifier, it cannot be overridden in a subclass.

(Multiple Choice)
4.8/5
(40)
Showing 21 - 40 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)