Object Oriented Programming MCQs

Page No. 71

The keyword static is used _______________


aWith declaration inside class and with definition outside the class

✖


bWith declaration inside class and not with definition outside the class

✓


cWith declaration and definition wherever done

✖


dWith each call to the member function

✖



Which keyword should be used to declare the static member functions?


a static

✓


bstat

✖


c const

✖


d common

✖


View Answer static

The static member functions _______________


aCan’t be declared const

✖


bCan’t be declared volatile

✖


cCan’t be declared const or volatile

✖


dCan’t be declared const, volatile or const volatile

✓



The static members are ______________________


a Created with each new object

✖


bCreated twice in a program

✖


cCreated as many times a class is used

✖


dCreated and initialized only once

✓



Which among the following is not applicable for the static member functions?


a Variable pointers

✖


b void pointers

✖


cthis pointer

✓


dFunction pointers

✖


View Answer this pointer

Which is correct syntax to access the static member functions with class name?


aclassName . functionName;

✖


bclassName -> functionName;

✓


cclassName : functionName;

✖


dclassName :: functionName;

✖



The static member functions ____________________


aCan be called using class name

✓


bCan be called using program name

✖


c Can be called directly

✖


dCan’t be called outside the function

✖



The static member functions __________________


aHave access to all the members of a class

✖


bHave access to only constant members of a class

✖


cHave access to only the static members of a class

✓


dHave direct access to all other class members also

✖



Which among the following is correct definition for static member functions?


aFunctions created to allocate constant values to each object

✖


bFunctions made to maintain single copy of member functions for all objects

✓


c Functions created to define the static members

✖


dFunctions made to manipulate static programs

✖



Pass by reference and pass by value can’t be done simultaneously in a single function argument list.


aTrue

✖


bFalse

✓


cA & B

✖


d None of the above

✖


View Answer False

Goto Page No.

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