October 11, 2010 at 5:47 PM
Encapsulation - Hiding the implementation details of a
Class. Once a class is Encapsulated then we Cannot directly
access that class members.Encapsulation allows you to migrate your implementations over time without breaking the code that depends on the public interface of your classes.
Polymorphism - Ability to process an Object differently
depending upon their Data Type or Class.
In simple words, One function - different implementations.
Polymorphism is the capability of an action or method to do different things based on the object that it is acting upon. This is the third basic principle of object oriented programming. Overloading and overriding are two types of polymorphism .
Inheritance-Inheritance is the capability of a class to use the properties and methods of another class while adding its own functionality. A class of object can inherit the properties and methods of an another class of object.
Advantage : reuseability of code and accessibility of properties and
methods of derived class by subclass.