Exam 10: Inheritance

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

All methods in an abstract class must also be declared abstract.

Free
(True/False)
4.8/5
(43)
Correct Answer:
Verified

False

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

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

A

In the following code, what will the call to super do? public class ClassB extends ClassA { Public ClassB() { Super(40); System.out.println("This is the last statement "+ "in the constructor."); } }

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

C

What is required for an interface method that has a body?

(Multiple Choice)
4.7/5
(40)

If ClassC is derived from ClassB which is derived from ClassA, this would be an example of

(Multiple Choice)
4.8/5
(43)

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

(Multiple Choice)
4.9/5
(39)

Given the following code, which statement is true? public class ClassB implements ClassA{ }

(Multiple Choice)
4.8/5
(38)

A functional interface is simply an interface that has one abstract method.

(True/False)
4.7/5
(41)

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

(Multiple Choice)
5.0/5
(41)

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

(Multiple Choice)
4.9/5
(38)

A subclass can directly access __________.

(Multiple Choice)
4.8/5
(45)

When an "is a" relationship exists between objects, the specialized object has __________.

(Multiple Choice)
4.8/5
(40)

In a class hierarchy __________.

(Multiple Choice)
4.8/5
(32)

__________ is a special type of expression used to create an object that implements a functional interface.

(Multiple Choice)
4.8/5
(40)

When a subclass overloads a superclass method __________.

(Multiple Choice)
4.9/5
(34)

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

(Multiple Choice)
5.0/5
(35)

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

A protected member of a class may be directly accessed by __________.

(Multiple Choice)
4.8/5
(33)

Inheritance involves a subclass, which is the general class, and a superclass, which is the specialized class.

(True/False)
4.9/5
(37)

Which of the following is the operator used to determine whether an object is an instance of a particular class?

(Multiple Choice)
4.8/5
(38)
Showing 1 - 20 of 64
close modal

Filters

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