Object Oriented Programming MCQs

Page No. 4

Object can’t be used with pointers because they belong to user defined class, and compiler can’t decide the type of data may be used inside the class.


aTrue

✖


bFalse

✓


cA & B

✖


d None of these

✖


View Answer False

Which among the following is correct?


aclass student{ }s1,s2; s1.student()=s2.student();

✖


bclass student{ }s1; class topper{ }t1; s1=t1;

✖


cclass student{ }s1,s2; s1=s2;

✓


dclass student{ }s1; class topper{ }t1; s1.student()=s2.topper();

✖



When an object is returned___________


aA temporary object is created to return the value

✓


bThe same object used in function is used to return the value

✖


cThe Object can be returned without creation of temporary object

✖


dObject are returned implicitly, we can’t say how it happens inside program

✖



Object declared in main() function _____________


aCan be used by any other function

✖


bCan be used by main() function of any other program

✖


cCan’t be used by any other function

✓


dCan be accessed using scope resolution operator

✖



Which among the following is wrong?


aclass student{ }; student s;

✖


babstract class student{ }; student s;

✓


cabstract class student{ }s[50000000];

✖


dabstract class student{ }; class toppers: public student{ }; topper t;

✖



If a local class is defined in a function, which of the following is true for an object of that class?


aObject is accessible outside the function

✖


bObject can be declared inside any other function

✖


cObject can be used to call other class members

✖


dObject can be used/accessed/declared locally in that function

✓



How members of an object are accessed?


aUsing dot operator/period symbol

✓


bUsing scope resolution operator

✖


cUsing member names directly

✖


dUsing pointer only

✖



Functions can’t return objects.


aTrue

✖


b False

✓


cA & B

✖


d None of these

✖


View Answer False

What is size of the object of following class (64 bit system)?<br><br> class student { int rollno; char name[20]; static int studentno; };


a20

✖


b22

✖


c24

✓


d28

✖


View Answer 24

The object can’t be __________


aPassed by reference

✖


bPassed by value

✖


cPassed by copy

✖


dPassed as function

✓


View Answer Passed as function

Goto Page No.

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