Question 1: C++ OOPS - Access Specifiers
By default, members of a C++ class are:
Question 2: C++ OOPS - Parameterized Constructor
If `class Box` has a constructor `Box(int h, int w)`, how do we correctly create an object?
Question 3: C++ OOPS - Example of Encapsulation
If age is a private member of class Person, how should it be accessed?
Question 4: C++ OOPS - Access Specifier in Inheritance
If a base class is inherited as private, what happens to its public members in the derived class?
Question 5: C++ OOPS - Function Overloading
What will the following code output?
Question 6: C++ OOPS Interface through Abstract Class
How can abstraction be achieved in C++?
Question 7: C++ OOPS Friend Function Example
What will be the output of this code?
Question 8: C++ OOPS Static Variable in Class
What will be the output?
Question 9: C++ OOPS Unary Operator Overloading Example
What will be the output?
Question 10: C++ OOPS Virtual Function Example
What will be the output?
Question 11: C++ OOPS - Member Function Declaration
Where can member functions of a class be defined?
Question 12: C++ OOPS - Constructor Overloading
What does constructor overloading in C++ mean?
Question 13: C++ OOPS - Benefit of Encapsulation
Which of the following is NOT a benefit of encapsulation?
Question 14: C++ OOPS - Code Example Single Inheritance
What will be the output of the following code?
Question 15: C++ OOPS - Operator Overloading
Which operator cannot be overloaded in C++?
Question 16: C++ OOPS Pure Virtual Function Example
What will be the output of the following code?
Question 17: C++ OOPS Friend Function and Encapsulation
Does declaring a function as a friend violate encapsulation?
Question 18: C++ OOPS Static Member Initialization
Where must static data members of a class be defined?
Question 19: C++ OOPS Binary Operator Overloading
Which function signature correctly overloads the binary + operator inside a class Complex?
Question 20: C++ OOPS Non-Virtual Function Call
What happens if virtual is removed in the above code?