Object Oriented Programming MCQs

Page No. 86

What is the new operator?


a Allocates memory for an object or array


bAllocates memory for an object or array and returns a particular pointer


cUsed as return type when an object is created


d Used to declare any new thing in a program



The delete operator __________________________


aCan be defined for each class


b Can’t be defined for each class


cCan be defined globally only


dCan’t be defined in a program explicitly



. For objects that are not of class type ______________


a Global delete operator is invoked


b Local delete operator is invoked


cGlobal user defined function is invoked


dLocal function to delete object is called



The delete operator __________________


aInvokes function operator delete


bInvokes function defined by user to delete


cInvokes function defined in global scope to delete object


dDoesn’t invoke any function



Which cases among the following produces the undefined result?


a delete [] on an independent object


bdelete on an object array


cdelete [] on an object and delete on object array


dUndefined result is never produced



. Which is the correct syntax to delete an array of objects?


adelete [] objectName;


bdelete * objectName;


cobjectName[] delete;


ddelete objectName[];


View Answer delete [] objectName;

Which is the correct syntax to delete a single object?


adelete *objectName;


bobjectName delete;


c delete objectName;


dobjectName *delete;


View Answer delete objectName;

How many variants of delete operator are available?


aOnly 1


bOnly 2


cOnly 3


dOnly 4


View Answer Only 2

If delete is applied to an object whose l-value is modifiable, then _______________ after the object is deleted.


a Its value is defined as null


b Its value is defined as void


cIts value is defined as 0


dIts value is undefined



When delete operator is used ___________________ (If object has a destructor)


aObject destructor is called after deallocation


bObject destructor is called before deallocation


cbject destructor is not used


dObject destructor can be called anytime during destruction



Goto Page No.

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