Object Oriented Programming MCQs

Page No. 32

What will be the output of the following code?


aPoint 1: 100, 100 Point 2: 200, 200

✖


bPoint 1: 200, 200 Point 2: 100, 100

✖


cPoint 1: 100, 100 Point 2: 100, 100

✖


dPoint 1: 200, 200 Point 2: 200, 200

✓



Does use of object reference in assignment or passing means copy of the object is being used?


aNo, because the copy would create a new temporary variable

✖


bNo, because the copy would not help to make changes to main object

✖


cYes, because the reference directly means using address

✓


d Yes, because the reference directly means the constructors are involved

✖



Whenever an object is assigned to a variable or passed to a method ________________


aActually the objects aren’t used

✓


bActually only the objects are used

✖


cActually a pointer to an object is used

✖


dActually copy of object is used

✖



What is reference to an object?


a It is address of an object

✖


bIt is address of where the variables and methods of object are stored

✓


cIt is pointer having address of an object

✖


d It is address of only variables and not the methods of an object

✖



In java, ____________________ takes care of managing memory for objects dynamically.


aFree collector

✖


bDust collector

✖


cMemory manager

✖


dGarbage collector

✓


View Answer Garbage collector

Which function is called whenever an object goes out of scope?`


aDestructor function

✓


b Constructor function

✖


cDelete function

✖


dFree function

✖


View Answer Destructor function

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


amalloc()

✖


bcalloc()

✖


ccreate()

✖


dmalloc() and calloc()

✓


View Answer malloc() and calloc()

Using new is type safe as _______________________


aIt require to be specified with type of data

✖


bIt doesn’t require to be specified with type of data

✓


c It requires the name of data

✖


d It allocated memory for the data

✖



Is an array of characters always a string?


aYes, always

✖


b Yes, if each character is terminated by null

✖


cNo, since each character is terminated by null

✖


dNo, never

✓


View Answer No, never

Two dimensional array can’t be initialized with the declaration.


aTrue

✖


bFalse

✓


cA & B

✖


dNone of these

✖


View Answer False

Goto Page No.

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