Java Programming - Chapter 10 - Introduction to Inheritance

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Derived class

A class that inherits from a base class.

Base class

A class that is used as a basis for inheritance.

Unified Modeling Language (UML)

A graphical language used by programmers and analysts to describe classes and object-oriented processes.

Inheritance

A mechanism that enables one class to inherit, or assume, both the behavior and the attributes of another class.

Aggregation

A type of composition in which a class contains one or more members of another class that would continue to exist without the object that contains them.

Class diagram

A visual tool that provides you with an overview of a class. It consists of a rectangle divided into three sections - the top section contains the name of the class, the middle section contains the names and data types of the attributes, and the bottom section contains the methods.

Parent class

Base class

Superclass

Base class

Child class

Derived class

Subclass

Dervied class

Fragile

Fragile classes are those that are prone to errors.

Inlining

Inlining the code is an automatic process that optimizes performance. Because a final method's definition can never be overridden, the compiler can optimize a program's performance by removing the calls to final methods and replacing them with the expanded code of their definitions at each method call location.

Subtype polymorphism

The ability of one method name to work appropriately for different subclasses of a parent class.

Information hiding

The concept of keeping data private.

instanceof operator

The instanceof operator determines whether an object that is the operand on the left is a member or descendant of the class that is the operand on the right.

extends

The keyword extends is used to achieve inheritance in Java.

protected

The keyword protected provides you with an intermediate level of security between public and private access. Protected members are those that can be used by a class and its descendants.

super

The keyword super refers to the parent or superclass of the class in which you use it.

Composition

The relationship in which one class contains one or more members of another class that would not continue to exist without the object that contains them.

Polymorphism

The technique of using the same method name to indicate different implementations.

Virtual method calls

Those in which the method used is determined when the program runs, because the type of the object used might not be known until the method executes. In Java, all instance method calls are virtual calls by default.

Override a method

To override a method in a parent class is to create a method in a child class that has the same name and parameter list as a method in its parent class.

Upcast

To upcast an object is to change it to an object of a class higher in the object's inheritance hierarchy.


Set pelajaran terkait

Developmental Psychology Chapter 12 Terms

View Set

PL Naturalization questions 1-30

View Set

Ch1: The Professional Property Manager

View Set

WoB Chapters 3&4 Sample Questions

View Set