Object Oriented Programming MCQs

Page No. 26

How to access members of the class inside a member function?


aUsing this pointer only


bUsing dot operator


cUsing arrow operator


dUsed directly or with this pointer



Static member functions _____________


aContains “this” pointer for data members


b Contains “this” pointer if used for member functions


cDoesn’t contain “this” pointer


d Doesn’t contain “this” pointer if member functions are referred



What happens if non static members are used in static member function?


aCompile time error


bRuntime error


cExecutes fine


dExecutes if that member function is not used


View Answer Compile time error

What are inline member functions?


aMember functions which can be called without object


bMember functions whose definition is expanded in place of its call


cMember functions whose definition is faster than simple function


dMember function which is defined in single line



How can a static member function be called in the main function?


aUsing dot operator


bUsing arrow operator


cUsing dot or arrow operator


dUsing dot, arrow or using scope resolution operator with class name



How many types of member functions are generally there in C++?


a2


b3


c4


d5


View Answer 5

Which among the following best describes member functions?


a Functions which are defined within the class


bFunctions belonging a class


cFunctions in public access of a class


dFunctions which are private to class



Which among the following is the main advantage of using local classes?


aMake program more efficient


b Makes program execution faster


cHelps to add extra functionality to a function


dHelps to add more members to a function



Can a function, other than the enclosing function of local class, access the class members?


a Yes, using object


bYes, using direct call


cYes, using pointer


dNo, can’t access


View Answer No, can’t access

What is the scope of local class?


aWithin the class only


bWithin the function


cWithin the program


dOne time creation and live till end of program


View Answer Within the function

Goto Page No.

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