Object Oriented Programming MCQs

Page No. 59

Which among the following are valid ways of overloading the operators?


aOnly using friend function


bOnly using member function


cEither member functions or friend functions can be used


dOperators can’t be overloaded



Which operator can be used to free the memory allocated for an object in C++?


aFree()


bdelete


cUnallocate


dCollect


View Answer delete

If an object is declared in a user defined function __________________


aIts memory is allocated in stack


bIts memory is allocated in heap


cIts memory is allocated in HDD


dIts memory is allocated in cache



The memory allocated for an object ____________________


aCan be only dynamic


bCan be only static


cCan be static or dynamic


dCan’t be done using dynamic functions



Which operator can be used to check the size of an object?


asizeof(objectName)


bsize(objectName)


csizeofobject(objectName)


dsizedobject(objectName)


View Answer sizeof(objectName)

Which among the following keyword can be used to free the allocated memory for an object?


adelete


b free


ceither delete or free


donly delete


View Answer either delete or free

When is the memory allocated for an object gets free?


aAt termination of program


bWhen object goes out of scope


cWhen main function ends


dWhen system restarts



Which keyword among the following can be used to declare an array of objects in java?


anew


bcreate


callocate


darr


View Answer new

How much memory will be allocated for an object of class given below?


a22 Bytes


b24 Bytes


c20 Bytes


d18 Bytes


View Answer 22 Bytes

Which of the following function can be used for dynamic memory allocation of objects?


amalloc( )


bcalloc( )


ccreate( )


dboth malloc( ) and calloc( )



Goto Page No.

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