adplus-dvertising

Welcome to the Objects and Classes in OOPs MCQs Page

Dive deep into the fascinating world of Objects and Classes in OOPs with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Objects and Classes in OOPs, a crucial aspect of Object Oriented Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Objects and Classes in OOPs, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Object Oriented Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Objects and Classes in OOPs. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Object Oriented Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Objects and Classes in OOPs. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Objects and Classes in OOPs MCQs | Page 11 of 15

Q101.
What is the output of following program?
template <typename T>
void test(const T&x) 
{
    static int count = 0;
    cout &lt;&lt; "x = " &lt;&lt; x &lt;&lt; " count = " &lt;&lt; count &lt;&lt; endl;
    ++count;
    return;
}
 
void main() 
{
    test<int> (2);
    test<int>(2);
    test<double>(2.2);
}
Discuss
Answer: (c).x = 2 count = 0
x = 2 count = 1
x = 2.2 count = 0
Q102.
If template class is defined, is it necessary to use different types of data for each call?
Discuss
Answer: (a).No, not necessary
Q103.
How many generic types can be given inside a single template class?
Discuss
Answer: (d).As many as required
Q104.
Template classes must have at least one static member.
Discuss
Answer: (b).False
Discuss
Answer: (a).It is parent of any of its derived class
Q106.
A base class is also known as _____________ class.
Discuss
Answer: (c).Super
Q107.
An abstract class is always a __________ class.
Discuss
Answer: (a).Base
Q108.
How many base classes can a single class inherit in java?
Discuss
Answer: (a).1
Discuss
Answer: (c).Make a class derive from it
Q110.
If a base class is being derived by two other classes, which inheritance will that be called?
Discuss
Answer: (d).Hierarchical

Suggested Topics

Are you eager to expand your knowledge beyond Object Oriented Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!