Exam 9: Inheritance

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

All fields declared in an interface

Free
(Multiple Choice)
4.9/5
(39)
Correct Answer:
Verified

D

This shows the inheritance relationships among classes in a manner that is similar to a family tree.

Free
(Multiple Choice)
4.7/5
(38)
Correct Answer:
Verified

D

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.

Free
(Multiple Choice)
4.7/5
(42)
Correct Answer:
Verified

C

If a subclass constructor does not explicitly call a superclass constructor,

(Multiple Choice)
4.7/5
(39)

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

(True/False)
4.8/5
(38)

In an inheritance relationship, the subclass constructor always executes before the superclass constructor.

(True/False)
4.9/5
(42)

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

(Multiple Choice)
4.7/5
(37)

When a class does not use the extends key word to inherit from another class, Java automatically extends it from the ________ class.

(Multiple Choice)
4.8/5
(33)

When a class implements an interface, an inheritance relationship known as ________ is established.

(Multiple Choice)
4.9/5
(41)

All methods specified by an interface are

(Multiple Choice)
4.8/5
(28)

Because every class directly or indirectly inherits from the Object class, every class inherits the Object class's members.

(True/False)
4.8/5
(31)

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)
5.0/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.9/5
(38)

A subclass can directly access

(Multiple Choice)
4.9/5
(31)

Protected class members can be denoted in a UML diagram with the ________ symbol.

(Multiple Choice)
4.9/5
(32)

In a class hierarchy,

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
4.7/5
(32)

In the following statement, which is the interface? Public class ClassA extends ClassB implements ClassC

(Multiple Choice)
4.8/5
(44)

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

(True/False)
5.0/5
(37)

In the following statement, which is the subclass? Public class ClassA extends ClassB implements ClassC

(Multiple Choice)
4.9/5
(31)
Showing 1 - 20 of 40
close modal

Filters

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