• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/26

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

26 Cards in this Set

  • Front
  • Back

A common form of reuse of classes is _____.

inheritance

We can organize classes into _____ of functionality.

hierarchies

The class at the top of the hierarchy

superclass

_____ defines instance variables and methods common to all classes in the hierarchy.

superclass

A _____ can inherit directly from only one _____.

subclass


superclass

(T/F) A class can only be either a subclass or a superclass.

False


(A class can be both a subclass and a super class.)

A subclass which adds fields and methods

Override (means hide)

All classes inherit from the _____ class.

Object

The superclass name specified after the extends keyword is called the _____.

direct superclass

_____ members are inherited by subclasses (like public members), while still being hidden from client classes(like private members).

protected

Constructors (are, are not) inherited.

are not

"The default constructor of the subclass automatically calls the default constructor of the superclass." describes _____.

Implicit invocation

A subclass can _____ an inherited method by providing a new version of the method.

override (or replace)

When the client calls the method, it will call the _____ version. The _____ method is invisible to the client of the subclass.

subclass


superclass

Declaring fields as _____ allows them to be accessed directly by subclass methods.

protected

_____ is a class that is not completely implemented.

An abstract class

Usually, the abstract class contains at least one _____.

abstract method

An abstract method specifies an API but doesn't provide _____.

an implemention

An abstract class (can, cannot) be used to instantiate objects.

Cannot

(Because the class is not complete.)


(But an object reference to it can be declared.)

Abstract methods (can, cannot) be called.

cannot

Abstract methods (can, cannot) be declared as private or static.

cannot

An important concept in inheritance is that an object of a subclass is also an object of any of its superclasses. That concept is the basis for an important OOP feature, called _____.

polymorphism

_____ simplifies the processing of various objects in the same class hierarchy.

polymorphism


(Because we can use the same method call for any object in the hierarchy using a superclass object reference.)

Four requirements of polymorphism

1) the classes are in the same hierarchy.


2) all subclasses override the target method.


3) a subclass object reference is assigned to a superclass object reference.


4) The superclass object reference is used to call the target method.

To allow a class to inherit behavior from multiple sources, Java provides the _____.

interface

All interface cannot be instantiated because they are _____.

abstract