Cpp Programming Quiz 121 – How many objects can be created from an abstract class?
Question: How many objects can be created from an abstract class? [A]. Zero [B]. One[C]. Two [D]. As many as we want Answer: Option A
Question: How many objects can be created from an abstract class? [A]. Zero [B]. One[C]. Two [D]. As many as we want Answer: Option A
Question: Which of the following statements about virtual base classes is correct? [A]. It is used to provide multiple inheritance. [B]. It is used to avoid multiple copies of base class in derived class.[C]. It is used to allow multiple…
Question: What does the class definitions in following code represent? class Bike { Engine objEng; }; class Engine { float CC; }; [A].kind of relationship [B].has a relationship [C].Inheritance [D].Both A and B Answer: Option B
Question: What happens when we try to compile the class definition in following code snippet? class Birds {}; class Peacock : protected Birds {}; [A].[ez-toc] It will not compile because class body of Birds is not defined. [B].It will not…
Question: Which of the following statement is correct regarding destructor of base class? [A].Destructor of base class should always be static. [B].Destructor of base class should always be virtual.[C].Destructor of base class should not be virtual. [D].Destructor of base class…
Question: Which of the following type of data member can be shared by all instances of its class? [A]. Public [B]. Inherited[C]. Static [D]. Friend Answer: Option C
Question: Which of the following means “The use of an object of one class in definition of another class”? [A]. Encapsulation [B]. Inheritance[C]. Composition [D]. Abstraction Answer: Option C
Question: How can we make a class abstract? [A]. By making all member functions constant. [B]. By making at least one member function as pure virtual function.[C]. By declaring it abstract using the static keyword. [D]. By declaring it abstract…
Question: Which of the following statements is correct when a class is inherited privately? [A]. Public members of the base class become protected members of derived class. [B]. Public members of the base class become private members of derived class.[C].…
Question: Which of the following is the only technical difference between structures and classes in C++? [A]. Member function and data are by default protected in structures but private in classes. [B]. Member function and data are by default private…