Object Oriented Programming

December 19, 2012


Object is an instance of a class.  All objects have a state and behavior.


Class is the blueprint from which individual objects are created


Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses.


Methods form the object’s interface with the outside world. An interface is a group of related methods with empty bodies.  Interface separates implementation and defines the structure. It is useful when the implementation changes frequently.  Interface forms a contract between the class and the outside world.

Abstract Class

Abstract classes cannot be instantiated.  It can only be used as a super class for other classes that extend the abstract class.  Abstract classes are declared with keyword abstract.  Abstract class methods can have implementations. Abstract class’s methods can’t have implementation only when declared abstract.


Encapsulation is inclusion within a program object of all the resources needed for the object to function.  It allows class to change its internal implementation without hurting the overall functioning of the system.


Polymorphism is the ability to request that the same operations be performed by a wide range of different types of things.

Method overloading

Ability to define several methods all with the same name

Method overridding

Subclass overrides a specific implementation of a method that is already provided by one of its super classes.