1. What is C++?
C++ is an object-oriented programming language developed as an extension of C.
2. Who developed C++?
C++ was developed by Bjarne Stroustrup.
3. Why is C++ called an object-oriented language?
Because it supports classes, objects, inheritance, and polymorphism.
4. What is a class?
A class is a blueprint for creating objects.
5. What is an object?
An object is an instance of a class.
6. Difference between C and C++?
C is procedural, C++ supports both procedural and object-oriented programming.
7. What is encapsulation?
Encapsulation binds data and functions together in a class.
8. What is data hiding?
Restricting access to data using access specifiers.
9. What are access specifiers?
public, private, protected.
10. What is inheritance?
Inheritance allows one class to acquire properties of another class.
11. Types of inheritance in C++?
Single, Multiple, Multilevel, Hierarchical, Hybrid.
12. What is polymorphism?
Same function name performing different tasks.
13. Types of polymorphism?
Compile-time and Runtime.
14. What is function overloading?
Multiple functions with the same name but different parameters.
15. What is operator overloading?
Giving special meaning to operators for user-defined data types.
16. What is runtime polymorphism?
Polymorphism achieved using virtual functions.
17. What is a virtual function?
A function that supports dynamic binding.
18. What is constructor?
A special function that initializes an object.
19. Types of constructors?
Default, Parameterized, Copy constructor.
20. What is destructor?
A function that releases resources of an object.
Comments
Post a Comment