Object Oriented Programming MCQs

Page No. 27

Can two different functions have local class with same name?


aYes, since local


bNo, names must be different


cNo, scope doesn’t work here


dNo, ambiguity arises


View Answer Yes, since local

All the data members of local class must be ___________


aDefined with declaration


b Defined in constructor


cDeclared and defined in constructor


dDeclared using a member function



How many local classes can be defined inside a single function?


aOnly 1


b Only 3


c Only 5


d As many as required



Which language can use inheritance with local classes?


aKotlin


b Java


cSmallTalk


dSAP ABAP


View Answer SAP ABAP

The enclosing function has no special access to the members of the local class.


a True


bFalse


cA & B


dNone of these


View Answer True

All the member functions of local classes are __________ by default.


aStatic


bInline


cAbstract


dVirtual


View Answer Abstract

Can static variables be declared inside a local class?


aYes, with public access specifier


bYes, anywhere as required


c No, not possible in private access specifier


dNo, not possible anyway



Local classes can access the type names and enumerators defined by the enclosing function.


aTrue


bFalse


cA & B


dNone of these


View Answer True

Which type of data can a local class access from the function in which it is defined?


a Static and extern


bAbstract and static


c Void and extern


dConst and static


View Answer Static and extern

Can local class members access/use the general local variables (except static, abstract etc.) of the function in which it is defined?


aYes, it can access with arrow operator


bNo, it can’t access with dot operator


cYes, it can access using dot operator


dNo, it can’t access In anyway



Goto Page No.

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