JAVA Ch 9

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:35 PM on 4/20/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

Employing inheritance reduces errors because _________________.

many of the methods a subclass needs have already been used and tested

2
New cards

A base class can also be called a _________________.

superclass

3
New cards

Which of the following choices is the best example of a parent class/child class relationship?

BodyOfWater/River

4
New cards

A class named Building has a public, nonstatic method named getFloors(). If School is a child class of Building, and modelHigh is an object of type School, which of the following statements is valid?

modelHigh.getFloors();

5
New cards

When a subclass method has the same name and argument types as a superclass method, the subclass method _________________ the superclass method.

overrides

6
New cards

When you instantiate an object that is a member of a subclass, the _________________ constructor executes first.

parent class

7
New cards

If the only constructor in a superclass requires arguments, its subclass _________________.

must contain a constructor

8
New cards

A child class Motorcycle extends a parent class Vehicle. Each class constructor requires one String argument. The Motorcycle class constructor can call the Vehicle class constructor with the statement _________________.

super("Suzuki");

9
New cards

If you create a data field or method that is _________________, it can be used within its own class or in any classes extended from that class.

public or protected

10
New cards

You use a _________________ method access specifier when you create methods for which you want to prevent overriding in extended classes.

final

11
New cards

When a parent class contains a static method, child classes _________________ override it.

cannot

12
New cards

Abstract classes differ from other classes in that you _________________.

cannot instantiate objects from them

13
New cards

An abstract class Dwelling has two subclasses, SingleFamily and MultiFamily. None of the constructors for these classes requires any arguments. Which of the following statements is legal?

SingleFamily myHome = new SingleFamily();

14
New cards

An abstract class Employee has two subclasses, Permanent and Temporary. The Employee class contains an abstract method named setType(). Before you can instantiate Permanent and Temporary objects, which of the following statements must be true?

You must code statements for the setType() method within both the Permanent and Temporary classes

15
New cards

Which of the following statements is true?

Superclasses can contain abstract methods

16
New cards

When you create a _________________ in Java, you create a variable name in which you can hold the memory address of an object

reference

17
New cards

An application's ability to select the correct subclass method to execute is known as _________________ method binding.

dynamic

18
New cards

You _________________ override the toString() method in any class you create.

can

19
New cards

The Object class equals() method takes _________________.

one argument

20
New cards

The alternative to multiple inheritance in Java is known as a(n) _________________.

interface