Overview of OOP

OOP = Object Oriented Programming.

Objectives:


Class = a template representing a self-contained element of a computer program (i.e. a module) that represents related information and has the cability to accomplish specific tasks through the invokation of methods.

Object = a particular instance of a class.

Instance = same thing as Object.

An OO Program = A set of classes, pluseobjects created from those classes and used as needed.

class library = group of classes that you can use in your own program. In Java, we also call this a package (a group of related classes).


Example
Dog Class and Instances
Dog Class and several Dog objects/instances




Inheritance



subclass = a class that inherits from another class.

superclass = a class that is its inheritance to another class. Example
heirarch of animal classes
Hierarchy of Animal Classes.


Note: Subclasses can override methods they have inherited if they want to change the corresponding behavior. For example, the method to calculate the Expected Lifespan for each Class of Dog, Cat, and Horse may be different from thier superclass Four-Legged Animal.



Interfaces