1. What is OOP?
OOP is a programming approach based on objects and classes.
2. What are the main features of OOP?
Encapsulation, Abstraction, Inheritance, Polymorphism.
3. What is a class?
A class is a blueprint for creating objects.
4. What is an object?
An object is an instance of a class.
5. Difference between class and object?
Class is a design, object is a real-world implementation.
6. What is encapsulation?
Wrapping data and functions together into a single unit.
7. How is encapsulation achieved in C++?
Using classes and access specifiers.
8. What is data hiding?
Protecting data using private access specifier.
9. What are access specifiers in C++?
public, private, protected.
10. What is inheritance?
Inheritance allows one class to use properties of another class.
11. Why inheritance is used?
To reuse code and reduce redundancy.
12. Types of inheritance in C++?
Single, Multiple, Multilevel, Hierarchical, Hybrid.
13. What is polymorphism?
One name, many forms.
14. Types of polymorphism?
Compile-time and Runtime polymorphism.
15. What is function overloading?
Functions with same name but different parameters.
16. What is operator overloading?
Redefining operators for user-defined data types.
17. What is runtime polymorphism?
Polymorphism achieved using virtual functions.
18. What is virtual function?
A function that is called using object pointer at runtime.
19. Why virtual function is needed?
To achieve dynamic binding.
20. What is dynamic binding?
Function call resolved at runtime.
Comments
Post a Comment