Object Oriented Programming MCQs

Page No. 70

The syntax for defining the static data members is __________


adataType className :: memberName = value;

✓


b dataType className : memberName = value;

✖


cdataType className . memberName = value;

✖


ddataType className -> memberName =value;

✖



The static data member ______________________


a Must be defined inside the class

✖


b Must be defined outside the class

✓


cMust be defined in main function

✖


dMust be defined using constructor

✖



Which is the correct syntax for declaring static data member?


astatic mamberName dataType;

✖


bdataType static memberName;

✖


cmemberName static dataType;

✖


d static dataType memberName;

✓



Any changes made to static data member from one member function _____________


aIs reflected to only the corresponding object

✖


b Is reflected to all the variables in a program

✖


cIs reflected to all the objects of that class

✓


d Is constant to that function only

✖



Which keyword should be used to declare static variables?


a static

✓


b stat

✖


ccommon

✖


dconst

✖


View Answer static

This set of Object Oriented Programming (OOPs) using C++ Multiple Choice Questions & Answers (MCQs) focuses on “Static Data Members”.


a Which among the following best defines static variables members?

✖


bData which is allocated for each object separately

✓


cData which is common to all the classes

✖


d Data which is common to a specific method

✖



If static data member are made inline, ______________


aThose should be initialized outside the class

✖


bThose can’t be initialized with the class

✖


cThose can be initialized within the class

✓


dThose can’t be used by class members

✖



The static data member _________________


a Can be mutable

✖


bCan’t be mutable

✓


cCan’t be integer

✖


dCan’t be characters

✖


View Answer Can’t be mutable

We can use the static member functions and static data member __________________


aEven if class object is not created

✓


bEven if class is not defined

✖


cEven if class doesn’t contain any static member

✖


dEven if class doesn’t have complete definition

✖



Which among the following can’t be used to access the members in any way?


aScope resolution

✖


bArrow operator

✖


cSingle colon

✓


dDot operator

✖


View Answer Single colon

Goto Page No.

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