Basic Concepts of Object Oriented Programming:
1. Objects
Objects are the basic run time entities in an object-oriented system. They may represent a person, a place, a bank account, a table of data or any item that the program has to handle. An object is the instance of the class. When a program is executed, the objects interact by sending messages to one another.
2. Classes
A class is the collection of related data and function under a single name. A class is collection of object of similar type. The entire set of data and code of an object can be made a user-defined data type with the help of class. Once a class has been defined, we can create any number of objects belonging to that class. Classes are user-defined that types and behave like the built-in types of a programming language.
3. Data Abstraction and Encapsulation
The wrapping up of data and function into a single unit (called class) is known as encapsulation. The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. This insulation of the data from direct access by the program is called data hiding or information hiding. Abstraction refers to the act of representing essential features without including the background details or explanation. Classes use the concept of abstraction; they encapsulate all the essential properties of the object that are to be created.
4. Inheritance
Inheritance is the process by which objects of one class acquired the properties of objects of another classes. In OOP, the concept of inheritance provides the idea of reusability. This means that we can add additional features to an existing class without modifying it. This is possible by deriving a new class from the existing one. The new class will have the combined feature of both the classes.
5. Polymorphism
Polymorphism means the ability to take more than on form. An operation may exhibit different behavior is different instances. For example, consider the operation of addition. For two numbers, the operation will generate a sum. If the operands are strings, then the operation would produce a third string by concatenation.
6. Dynamic Binding
Binding refers to the linking of a procedure call to the code to be executed in response to the call.
7. Message Passing
An object-oriented program consists of a set of objects that communicate with each other. Objects communicate with one another by sending and receiving information.