Object-Oriented Programming: Object Oriented Programming is a programming language model in that programs are organized around data or objects, rather than logic and functions. In fact, an object can be defined as a data field which has unique attributes and behavior.
The most popular OOP languages such as
Object-oriented programming is based on following principles such as
Class: It is an encapsulation of coding and data. Classes are an expanded version of structures. Structure contain multiple variables.
Object: Class is a user-defined data type and it is a variable of class type. It is utilizing to access class members.
Encapsulation: It is a process of wrapping data members and member functions in a single unit known as class. Using encapsulation, the programmer can't directly access the data. Data is only accessible via the object of the class.
Polymorphism: Polymorphism means more than one function with the same name and different working. In fact, it is static or dynamic. In static, memory can allocate at compile time. In dynamic, the memory will allocate at runtime. An example of static polymorphism such as operator overloading and function overloading. A virtual function is an example of dynamic polymorphism.
Inheritance: As a matter of fact, it means to access to the properties and features of one class into another class. The class which is going to provide its features to another class known as base class and the class that is using the features and properties of another class known as derived class.