Object Oriented Programming MCQs

Page No. 20

Which specifier allows a programmer to make the private members which can be inherited?


aPrivate


bDefault


cProtected


dProtected and default


View Answer Protected

Which access specifier is used when no access specifier is used with a member of class (java)?


aPrivate


bDefault


cProtected


d Public


View Answer Default

Which among the following can restrict class members to get inherited?


aPrivate


bProtected


cPublic


dAll three


View Answer Private

Which among the following can be used together in a single class?


aOnly private


bPrivate and Protected together


cPrivate and Public together


dAll three together


View Answer All three together

How many types of access specifiers are provided in OOP (C++)?


a1


b2


c3


d4


View Answer 3

Private member functions can be overloaded.


a True


bFalse


cA & B


d None of these


View Answer True

Which member will never be used from the following class?


aname variable will never be used


bmarks variable will never be used


cconstructor will never be used


ddisp() function will never be used



Choose the correct option for the code given below. class A{ static int c=0; public: A(){ c++; } };


aConstructor will make c=1 for each object created


bConstructor will make c=0 for each object created


cConstructor will keep number of objects created


dConstructor will just initialize c=0 then increment by 1



Which access specifier is/are most secure during inheritance?


aPrivate


bDefault


cProtected


dPrivate and default


View Answer Private

If private members have to be accessed directly from outside the class but the access specifier must not be changed, what should be done?


aSpecifier must be changed


bFriend function should be used


cOther public members should be used


dIt is not possible



Goto Page No.

Page 20 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