OOP Concepts

Date: 1/28/2002

Objects

An object is a representation of a physical thing or an actual part or process.  Think of it as a NOUN.

Properties

Properties are how you would describe an object.  Think of them as ADJECTIVES.

Methods

Methods are what the object can do.  Think of them as VERBS.

Inheritance (extends)

Java supports inheritance via the extends keyword. A class can only extend ONE other class.  The class will automatically get all public methods, including any code written for them.

Polymorphism (implements, extends)

Java supports polymorphism in two ways:

  1. When a class extends another, you can over-ride an inherited method and write your own code for it.
  2. A class implements one or more other classes.  This means that the class MUST include a method signature for ALL public methods it is implementing.  The class it is implementing is called an INTERFACE.  An interface class contains only method signatures- the methods do not contain code.  It is up to the implementing class to provide the code.