Q.1. What is Object Oriented Programming?
OOPS stands for Object Oriented Programming System. It is a program design technique, which is used to resolve problems of structured programming by binding data and function in a single unit called class. Here, data can be accessed only by the associated functions.
Object Oriented Programming (OOP) is a programming paradigm where the complete software operates as a bunch of objects. An object is a collection of data and methods that operate on its data.
Q.2. What are main features of OOPs?
Q.3. What is encapsulation?
Encapsulation is referred to one of the following two notions.
1) Data hiding: A language feature to restrict access to members of an object. For example, private and protected members in C++.
2) Bundling of data and methods together: Data and methods that operate on that data are bundled together. Encapsulation can be useful to keep data safe from outside interfaces.
Q.4 What is a polymorphism?
Polymorphism is the most important concept of OOPS. Polymorphism provides ability to use same name for different purposes.
In C++, functions and operators can be used to perform several (different) tasks by having same names. Two types of polymorphism are used:
- Static or Compile time polymorphism
- Function Overloading
- Operator Overloading
- Dynamic or Runtime polymorphism
- Virtual function or dynamic binding