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
(80)
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.9/5
(89)
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
(84)
Correct Answer:
Verified

C

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

(Multiple Choice)
4.8/5
(84)

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

(Multiple Choice)
4.8/5
(80)

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

(Multiple Choice)
4.9/5
(85)

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

(Multiple Choice)
4.8/5
(83)

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

(True/False)
4.7/5
(87)

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

(Multiple Choice)
5.0/5
(83)

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
(85)

A subclass can directly access __________.

(Multiple Choice)
4.9/5
(84)

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

(Multiple Choice)
4.8/5
(84)

In a class hierarchy __________.

(Multiple Choice)
4.9/5
(62)

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

(Multiple Choice)
4.8/5
(76)

When a subclass overloads a superclass method __________.

(Multiple Choice)
5.0/5
(78)

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

(Multiple Choice)
5.0/5
(78)

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
(95)

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

(Multiple Choice)
4.8/5
(79)

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

(True/False)
5.0/5
(89)

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
(86)
Showing 1 - 20 of 64
close modal

Filters

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