Object Oriented Programming MCQs

Page No. 85

Initializers __________________


aAre used for specifying arrays


bAre used to defined multidimensional arrays


cCan’t be specified for arrays


d Can’t be specified for any data



Which among the following is added in grammar of new operator?


aFinalize


b Arg


cInitializer


dAllocator


View Answer Initializer

Which among the following is true?


aNew operator can’t allocate functions but pointer to functions can be allocated


bNew operator can allocate functions as well as pointer to functions


cNew operator can allocate any type of functions


dNew operator is not applicable with functions allocation



The new operator _____________


aCan allocate reference types too


bDoesn’t allocate reference types


cCan allocate reference to objects


dDoesn’t allocate any data



For declaring data by using new operator ____________________


aType name can’t contain const


bType name can’t contain volatile


cType name can’t contain class declarations


d Type name can’t contain const, volatile, class declaration or enumerations



Which among the following is correct syntax to declare a 2D array using new operator?


achar (*pchar)[10] = new char[][10];


bchar (pchar) = new char[][10];


cchar (*char) = new char[10][];


dchar (*char)[][10]= new char;



In C++, if new operator is used, when is the constructor called?


aBefore the allocation of memory


bAfter the allocation of memory


c Constructor is called to allocate memory


dDepends on code



If new throws an error, which function can be called to write a custom exception handler?


a_set_handler


b _new_handler


c_handler_setter


d_set_new_handler


View Answer _set_new_handler

What happens when new fails?


a Returns zero always


b Throws an exception always


cEither throws an exception or returns zero


dTerminates the program



Microsoft C++ Components extensions support new keyword to _____________


aModify a vtable


bReplace a vtable slot entry


cAdd new vtable slot entries


d Rearrange vtable slot entries



Goto Page No.

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