Question 1: C++ OOPS - Object Initialization
Which of the following initializes an object car of class Car with a constructor taking two arguments?
Question 2: C++ OOPS - Order of Execution
What is the order of execution for constructors and destructors in nested objects?
Question 3: C++ OOPS - Encapsulation Security
Why does encapsulation improve security?
Question 4: C++ OOPS - Protected Members in Inheritance
If a member is declared protected in the base class, how is it inherited in a public derived class?
Question 5: C++ OOPS - Function Overriding
What will this print?
Question 6: C++ OOPS Abstract Class Pointer
What will be the output?
Question 7: C++ OOPS Operator Overloading with Friend Function
What will be the output?
Question 8: C++ OOPS Static Member Access
Which of the following is the correct way to access a static variable of a class `Sample` named `count`?
Question 9: C++ OOPS Overloading [] Operator
Which statement about overloading [] is correct?
Question 10: C++ OOPS V-Table and Object Size
How does adding virtual functions affect object size?
Question 11: C++ OOPS - Object Lifetime
When is a destructor of a class called automatically?
Question 12: C++ OOPS - Destructor Call
When is a destructor called for an automatic (stack) object?
Question 13: C++ OOPS - Real-life Example of Encapsulation
Which of the following is a real-world analogy for encapsulation?
Question 14: C++ OOPS - Function Overriding Code
What will the following code output?
Question 15: C++ OOPS - Runtime Polymorphism Example
What is the output?
Question 16: C++ OOPS Real-life Example of Abstraction
Which is the best real-life example of abstraction in C++?
Question 17: C++ OOPS Limitations of Friend Functions
Which of the following is NOT true about friend functions in C++?
Question 18: C++ OOPS Static vs Non-Static Member
What will be the output?
Question 19: C++ OOPS Operator Overloading Example (Mix)
What will be the output?
Question 20: C++ OOPS Virtual Function Override Example
What will be the output?