GP_OOPS_C++_Interview_Questions
GP_OOPS_C++_Interview_Questions
Constructor Method
It has the same name as the class It should have a different name than
name. the class name.
1
3. What are the main features of OOPs?
❖ Inheritance
❖ Encapsulation
❖ Polymorphism
❖ Data Abstraction
4. The disadvantage of OOPs?
❖ Requires pre-work and proper planning.
❖ In certain scenarios, programs can consume a large amount of memory.
❖ Not suitable for a small problem.
❖ Proper documentation is required for later use.
5. What is the difference between class and structure?
Class: User-defined blueprint from which objects are created. It consists of
methods or sets of instructions that are to be performed on the objects.
Structure: A structure is basically a user-defined collection of variables of
different data types.
Class Object