Object Oriented Programming MCQs

Page No. 84

What does dynamic_cast return after successful type casting?


aAddress of object which is converted


bAddress of object that is used for conversion


cAddress of object that is mentioned in the syntax


dDoesn’t return any address



What should be used for safe downcast?


aStatic cast


bDynamic cast


cManual cast


d Implicit cast


View Answer Dynamic cast

Downcasting ____________________


aCan result in unexpected results


bCan’t result in unexpected result


cCan result only in out of memory error


dCan’t result in any error



Downcasting is _______________________


aAlways safe


bNever safe


cSafe sometimes


d Safe, depending on code


View Answer Never safe

Which among the following is a mandatory condition for downcasting?


aIt must not be done explicitly


bIt must be done implicitly


cIt must be done explicitly


dIt can’t be done explicitly



What is downcasting?


aCasting subtype to supertype


bCasting supertype to subtype


cCasting subtype to supertype and vice versa


dCasting anytype to any other type



How does compiler convert “::operator new” implicitly?


aoperator new( sizeof( type ) )


boperator new( sizeof( ) )


cnew operator :: type sizeof( type )


dnew sizeof( type ) operator



If a new operator is defined for a class and still global new operator have to be used, which operator should be used with the keyword new?


aColon


bArrow


cDot


dScope resolution


View Answer Scope resolution

The new operator _________________


aInvokes function operator new


bDoesn’t invoke function operator new


cInvokes function operator only if required


dCan’t invoke function operator new implicitly



The objects allocated using new operator ________________


aAre destroyed when they go out of scope


bAre not destroyed even if they go out of scope


cAre destroyed anytime


dAre not destroyed throughout the program execution



Goto Page No.

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