Object Oriented Programming MCQs

Page No. 25

Data members ________________ (C++)


aCan be initialized with declaration in classes

✖


bCan be initialized only with help of constructors

✓


cCan be initialized either in declaration or by construc

✖


dCan’t be initialized

✖



What is the term used to indicate the variable and constants of a class?


a Data members

✓


b Variables of class

✖


cData characters

✖


dConstants

✖


View Answer Data members

Which among the following is not possible for member function?


aAccess protected members of parent class

✖


b Definition without return type

✖


cAccess public members of subclass

✓


d Access static members of class

✖



Which member function doesn’t require any return type?


a Static

✖


bConstructor

✖


cConst

✖


d Constructor and destructor

✓



A member function can _______________ of the same class.


aCall other member functions

✓


b Call only private member functions

✖


cCall only static member functions

✖


dCall only const member functions

✖



Which among the following is proper syntax for class given below?
class A
{
int a,b;
public : void disp();
}


avoid disp::A( ){ }

✖


b void A::disp( ){ }

✓


cvoid A:disp() { cout<

✖


dvoid disp:A(){ cout<

✖


View Answer void A::disp(){ }

Member function of a class can ____________


aAccess all the members of the class

✓


bAccess only Public members of the class

✖


cAccess only the private members of the class

✖


dAccess subclass members

✖



Member functions of a generic class are _____________


aNot generic

✖


bAutomatically generic

✓


cTo be made generic explicitly

✖


dGiven default type as double

✖


View Answer Automatically generic

If a virtual member function is defined ___________


aIt should not contain any body and defined by subclasses

✓


bIt must contain body and overridden by subclasses

✖


cIt must contain body and be overloaded

✖


dIt must not contain any body and should not be derived

✖



For overloading “( )”, “[ ]” or “->” operators, a class __________


aMust use static member functions

✖


bMust use non-static member functions

✖


cMust be non-static member and should not be friend of class

✓


d Must use static member function or a friend member function

✖



Goto Page No.

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