Object oriented programming languages uses some concept extensively which are as follows :
- Object - An object is a real world entity that have some characteristics and behavior. Objects are run-time entities. Object represents instance of its class. An objects can be defined as the collection of data members and member function of its class. A class can have more than one instance that means a class can have more than one object which may hold their relevant information or data. If a class name is declared than the object of that class must exist to access its properties. For example: A class "Vehicle" can have some properties like vehicle name, registration number etc., these properties are only accessible by the objects of the class vehicle.
- Class - A class is a data-type according to which objects are created or a class can be defined as a collection of objects which possesses same characteristics or properties. A class contain data members and member function which are accessible by its objects. For example : Person is a class which have some characteristics like two eyes two legs etc. and Rohan can be considered as its objects who possesses these characteristics.
- Abstraction/Encapsulation - Abstraction means hiding the unnecessary details and showing the essential details and encapsulation means wrapping up of data into a single unit called class. In a class all the data and methods of that class are wrapped up into a single unit called class and only the objects of that can class can access private data and the methods which operate on that data. For example : In a car only essential things are visible to the user like steering, gear, clutch etc and not the details like how the steering is moving the wheels internally or how the gear is changing internally.
- Inheritance - It is the process of making new class from an existing class or it is the process of transforming the properties from one class to another class. The new class formed is known as derived class and the class from which the class is derived is known as super class or base class. Inheritance are of types : single level, multilevel, hybrid, hierarchical. These are explained in the next post.
- Polymorphism - Polymorphism means single name multiple forms. It allows methods or variables to have different meaning for different objects. According to greek terminology it is the ability to take more than one form. overloading is an example of polymorphism.
- Dynamic Binding - It is the the ability to of the objects to recognize its class/method at runtime. Dynamic binding is explained in upcoming post with example program.
- Message passing - It is the ability of objects to communicate with each other. It is one of the important features of the object oriented programming languages which allows communication from one place to another in a program.
No comments:
Post a Comment