Object Oriented Programming MCQs

Page No. 64

How to access a private member function of a class?


aUsing object of class


bUsing object pointer


cUsing address of member function


dUsing class address



How many private member functions are allowed in a class?


aOnly 1


b Only 7


cOnly 255


dAs many as required


View Answer As many as required

In java, which rule must be followed?


aKeyword private preceding list of private member’s


bKeyword private with a colon before list of private member’s


cKeyword private with arrow before each private member


dKeyword private preceding each private member



If private member functions are to be declared in C++ then _____________


aprivate:


bprivate


cprivate(private member list)


dprivate :-


View Answer private:

Which syntax among the following shows that a member is private in a class?


aprivate: functionName(parameters)


bprivate(functionName(parameters))


cprivate functionName(parameters)


d private::functionName(parameters)



Which member can never be accessed by inherited classes?


aPrivate member function


bPublic member function


cProtected member function


dAll can be accessed



Which among the following is true?


aThe private members can’t be accessed by public members of the class


bThe private members can be accessed by public members of the class


cThe private members can be accessed only by the private members of the class


dThe private members can’t be accessed by the protected members of the class



Which is private member functions access scope?


aMember functions which can only be used within the class


bMember functions which can used outside the class


cMember functions which are accessible in derived class


dMember functions which can’t be accessed inside the class



All the public member functions ___________________


aCan’t access the private members of a class


bCan’t access the protected members of a class


cCan access only public members of a class


dCan access all the member of its class



The function main() must always be public.


aTrue


bFalse


cA & B


d None of these


View Answer True

Goto Page No.

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