Object Oriented Programming MCQs

Page No. 38

Can typeid() function be used with the object of generic classes?


aYes, only if default type is given

✖


bYes, always

✓


cNo, generic data can’t be determined

✖


dNo, never possible

✖


View Answer Yes, always

What are the two specializations of I/O template classes in C++?


a16-bit character and wide characters

✖


b8-bit character and wide characters

✓


c32-bit character and locale characters

✖


d64-bit characters and locale characters

✖



A template class defines the form of a class _____________________ it will operate.


aWith full specification of the data on which

✖


bWith full specification of the functions on which

✖


cWithout full specification of the data on which

✓


dWithout full specification of the functions on which

✖



Which is the most significant feature that arises by using template classes?


aCode readability

✖


bEase in coding

✖


cCode reusability

✓


dModularity in code

✖


View Answer Code reusability

What is the syntax to use explicit class specialization?


atemplate class myClass<>{ }

✖


btemplate class myClass{ }

✖


c template <> class myClass<>{ }

✖


d template <> class myClass{ }

✓



Can default arguments be used with the template class?


aYes, in some special cases

✖


b Yes, always

✓


cNo, it must satisfy some specific conditions first

✖


dNo, it can’t be done

✖


View Answer Yes, always

Which among the following is the proper syntax for the template class?


atemplate ;

✖


bTemplate ;

✖


ctemplate T named(T x, T y){ }

✓


dTemplate T1 named(T1 x, T2 y){ }

✖



A template class can have _____________


aMore than one generic data type

✓


bOnly one generic data type

✖


cAt most two data types

✖


dOnly generic type of integers and not characters

✖



If a base class is added with a few new members, its subclass must also be modified.


aTrue

✖


bFalse

✓


cA & B

✖


dNone of these

✖


View Answer False

How many base classes can a single derived class have in C++?


a1

✖


b2

✖


c3

✖


dAs many as required

✓


View Answer As many as required

Goto Page No.

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