i.e. code & data. Primarily based on the elements there are two main patterns in which the program could be written – Process Oriented Pattern : is a linear step wise flow of writing a program. One code follows the next in steps. For e.g. C language uses this particular pattern. Object Oriented Pattern : this way of writing programs takes into consideration the data i.e. objects with an interface to it. For e.g. C++ and Java uses this particular pattern. 1
to deal with complexity. It allows breaking down of complex systems into smaller manageable pieces. For e.g. we all drive cars unaware of the internal working parts. Thus we consider the car as a whole object rather than a compilation of different parts.
data and code into a single entity is termed as encapsulation. This feature makes sure that the data is not directly accessible beyond the bounding entity (data hiding) but is accessible through the code that will access the data instead. 3
by another object is termed as inheritance. It usually defines a hierarchy classification. Given an object A, if object B inherits object A, it not only copies the behavior and attributes of A but can also define its own special properties. Thus object B is a specialized object. A is called super object and B is called sub object. 4
term polymorphism means having many forms. This feature allows one interface to be used for a given set of common functions i.e. having one interface but multiple methods. For e.g. a dog can smell food, similarly he can also smell a cat and chase it. Though the output for smell is different the action of smelling is common in both. Thus we can define one common interface called smell but with completely different functionality. In non OOP programs this facility is not available, thus for each different action a different interface is required to be implemented. 5