Concepts of OOP

Some basic Concepts of OOP are given as follows:

Objects:

It is the basic run-time entity in object-oriented programming. Objects represent a person or a table of data that handles the program. It may also represent user-defined data such as vectors and lists. When a program is executed, the objects interact by sending messages to one another.

Objects

Classes:

Classes are user-defined data types. The entire set of data of code and its object can be made a user-defined data type that is called class. A class is a collection of objects and user-defined data types. It has the following syntax:

class class-name

Example:

class test{
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
};

Inheritance:

It is a process by which one class acquire the properties of objects of another class. In Concepts of OOP, Inheritance provides the idea of re-usability which means we can add additional features to an existing class without modifying it. It is possible to derive a new class from the existing class. The new class will have the combined features of both classes. The mechanism of inheritance is that it allows the programmer to reuse a class that is almost.

Data Abstraction & Encapsulation:

Abstraction refers to the act of representing essential features without including the background details or explanations. Abstraction is defined as a list of abstract attributes such as size, weight and cost, and functions to operate on these attributes.

The wrapping up of data and functions into a single unit is called encapsulation. Encapsulation is the most striking feature of a class. The data is not accessible to the outside world and only those functions which are wrapped in the class can access it.

Polymorphism:

It is s Greek term that means the ability to take more than one form. Polymorphism is an important concept of OOPs. Polymorphism plays an important role in allowing objects having different internal structures to share the same external interface which means a general class of operations may be accessed in the same manner even though specific actions are associated with each operation.

Dynamic Binding:

Binding means linking a procedure call to the code to be executed in response to the call. Dynamic Binding means that the code associated with a given procedure call is not known until the time of the call at run-time. Dynamic Binding is also called late binding.

Message Passing

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 much the same way as people pass messages to one another, this concept is called Message Passing. A message for an object is a request for execution of a procedure and there will invoke a function in the receiving object that generates the desired result.