Inheritance in Java
Terms
- inheritance
- An Object Oriented design technique which allows a new class to be
derived from an existing class. The new class inherits both variables
and methods of the parent or super class.
- super class
- A class from which another class is derived.
- parent/child
- Another term for the super/sub class relationship.
- base/derived
- Another term for the super/sub class relationship.
- sub class
- A class derived from another class.
- extends
- The directory path to a file location that begins with the root of
the directory in which the file is located.
- specialization
- A sub class has additional characteristics (attributes, behaviors, or
both) beyond its super class. It is a specialization of the super
class.
- generalization
- Ignores or does not include characteristics (attributes, behaviors,
or both) of a sub class. It is a generalization of the sub class.
- super reference
- A Java reserved word that refers to the super class.
- super. - refers to a member of the parent class
- super() - refers to a constructor of the parent
class
- visibility modifier
- A Java modifier that defines the scope in which a class member can be
accessed.
Modifiers include:
- public - visible to all other classes
- private - visible only within the class
- protected - visible to sub-classes
- class relationships
- Defines how one class is related to another class.
- uses - One class uses the objects or services of another
class
- has a - One class's attributes include one or more objects of
another class.
- is a - One class is/does everything of another class...and
more.
Classes you should know
- Enum
- Basic class defining the characteristics of enumerated types.
Today's notes
See ppt presentation - Experimenting
with Inheritance.
CS 239 - Spring 2006