OOPS Quiz (Set 14) OOPS (Set 14) 1 / 10 What is multiple inheritance in C++? The ability of a class to inherit attributes and behaviors from multiple parent classes The ability of a class to inherit attributes from a single parent class The ability of a class to inherit private members from parent classes The ability of a class to inherit only the methods from parent classes 2 / 10 What is the purpose of the 'friend' keyword in C++? To indicate that a function is a member of a class To indicate that a function can access private members of a class To indicate that a function cannot be accessed from outside the class To indicate that a function is virtual 3 / 10 What is a pure virtual function in C++? A function with no implementation that must be overridden in derived classes A function that can be accessed from any class A function used for type casting A function that cannot be overridden in derived classes 4 / 10 What is the 'virtual' keyword in C++? A keyword used to create private methods in a class A keyword used to create static methods in a class A keyword used to define a new class A keyword used to indicate that a method can be overridden in a subclass 5 / 10 What is a copy constructor in C++? A constructor used to create deep copies of objects A constructor used to create instances of classes A constructor used to create shallow copies of objects A constructor used to create dynamic objects 6 / 10 What is a constructor initializer list in C++? A list of constructors used to initialize multiple objects A list of methods used to initialize instance variables A list of arguments passed to a constructor A list of arguments used to initialize base and member objects of a class 7 / 10 What is a destructor in C++? A special method used to initialize objects A method used for type casting A method used to create instances of classes A special method used to release resources held by objects before they are destroyed 8 / 10 What is the role of the 'this' pointer in C++? To store the address of the current object To store the address of the next object To store the address of the previous object To store the address of the parent object 9 / 10 What is a factory method in OOP? A method used to create instances of classes A method used to access private members of a class A method used to create objects without specifying the exact class of object that will be created A method used to perform method overloading 10 / 10 What is the concept of method hiding in OOP? Defining a static method in a subclass with the same name as a static method in the parent class Defining a method in a subclass that has the same name but different parameters as a method in the parent class Creating multiple instances of a class Defining a new method in a subclass Your score isThe average score is 0% 0% Restart quiz