Object Oriented Programming MCQs

Page No. 19

Which among the following describes a destructor?


aA special function that is called to free the resources, acquired by the object


bA special function that is called to delete the class


cA special function that is called anytime to delete an object


d A special function that is called to delete all the objects of a class



Which specifier should be used for member functions of a class?


aPrivate


bDefault


cProtected


dPublic


View Answer Public

Which access specifier is usually used for data members of a class?


aPrivate


bDefault


cProtected


dPublic


View Answer Private

Which access specifier should be used so that all the parent class members can be inherited and accessed from outside the class?


aPrivate


bDefault or public


cProtected or private


dPublic


View Answer Public

If an abstract class has all the private members, then _________


aNo class will be able to implement members of abstract class


bOnly single inheritance class can implement its members


cOnly other enclosing classes will be able to implement those members


dNo class will be able to access those members but can implement.



If class B inherits class A privately. And class B has a friend function. Will the friend function be able to access the private member of class A?


aYes, because friend function can access all the members


bYes, because friend function is of class B


cNo, because friend function can only access private members of friend class


dNo, because friend function can access private member of class A also



On which specifier’s data, does the size of a class’s object depend?


aAll the data members are added


b Only private members are added


cOnly public members are added


dOnly default data members are added



Which access specifier should be used in a class where the instances can’t be created?


aPrivate default constructor


bAll private constructors


cOnly default constructor to be public


dOnly default constructor to be protected



If class A has add() function with protected access, and few other members in public. Then class B inherits class A privately. Will the user will not be able to call _________ from the object of class B.


aAny function of class A


bThe add() function of class A


cAny member of class A


dPrivate, protected and public members of class A



If a class has all the private members, which specifier will be used for its implicit constructor?


aPrivate


bPublic


cProtected


dDefault


View Answer Public

Goto Page No.

Page 19 of 93

Alphabetical MCQs Categories

Here below You find all kind of categories of MCQs in alphabetical order.


"Comprehensive Collection of MCQs: Alphabetically Organized by Subject"

"Discover an extensive collection of multiple-choice questions (MCQs) neatly categorized by subject from A to Z. This resource is designed for anyone eager to explore various topics in a straightforward and organized manner. Whether you're a student preparing for exams, an educator seeking supplementary materials, or simply curious about different subjects, this compilation offers a convenient way to learn and assess your knowledge. With questions arranged alphabetically, navigation is effortless, allowing you to delve into subjects of interest at your own pace. Engage, learn, and expand your understanding with this accessible and comprehensive repository of MCQs!"


BolPakistan

bolpakistan.com.pk includes Job Mcqs and Pak Mcqs is the Top Largest Mcqs Forum in World, in which you can read Mcqs of All Subjects, PPSC test preparation, FPSC, NTS and PPSC PAST PAPERS, PPSC PAST MCQS. A Collection of Repeated MCQs for JOBs seekers.

Copyright © 2024, Designed & Developed by BolPakistan