OOP MCQs Unit IV - OOP Multiple Choice Questions PDF

Title OOP MCQs Unit IV - OOP Multiple Choice Questions
Course Object oriented programming
Institution Savitribai Phule Pune University
Pages 43
File Size 828.2 KB
File Type PDF
Total Downloads 15
Total Views 142

Summary

OOP Multiple Choice Questions...


Description

Id Question A B C D Answer Marks Unit

1 What is meaning of template parameter? It is used to pass a type as argument Used to evaluate a type It can of no return type None of the mentioned A 1 IV

Id Question A B C D Answer Marks Unit

2 ______Keyword is used in template. Class Typename Both a and b Using C 1 IV

Id Question A B C D Answer Marks Unit

3 What is scope of template parameter? Inside a block only Inside the class only Throughout program All of the above A 1 IV

Id Question A B C D Answer Marks Unit

4 Function overloading is also similar to which of the following Operator overloading Destructor overloading Constructor overloading Virtual function B 1 IV

Id Question

5 Generic programming is approach of______________________which are applicable for all types Generalised algorithm Pseude algorithm

A B

C D Answer Marks Unit

Both a and b None of the above A 1 IV

Id Question A B C D Answer Marks Unit

6 Template are of types Function template Class template Both a and b None of the above C 1 IV

Id Question A B C D Answer Marks Unit

7 Class template can be created using________syntax. Templateclass classname Template class classname Both a and b None of the above mentioned C 1 IV

Id Question A B C D Answer Marks Unit

8 Syntax for creating a function template is Templatereturntype function name Template returntype function name Both a and b None of the above mentioned C 1 IV

Id Question

9 Pick up the correct statement i)template allow us to define generic classes and functions ii)template support generic programming iii)function template overloading is possible i only i and ii only ii and iii only i, ii and iii D

A B C D Answer

Marks Unit

1 IV

Id Question A B C D Answer Marks Unit

10 Template function can be overloaded True False

Id Question A B C D Answer Marks Unit

11 Why we use :: template-template parameter? binding rebinding both a &b none of these C 1 IV

Id Question A B C D Answer Marks Unit

12 Which of the things does not require instantiation? functions non virtual member function member class all of the mentioned D 1 IV

Id Question A B C D Answer Marks Unit

13 A template provides a convenient way to make a family of variables. functions classes B and C D 1 IV

Id Question A

14 Templates automatically create different versions of a function, depending on user input. TRUE

A 1 IV

B C D Answer Marks Unit

FALSE

Id Question A B C D Answer Marks Unit

15 A template class is designed to be stored in different containers. works with different data types. generates objects which must all be identical. generates classes with different numbers of member functions. B 1 IV

Id Question A B C D Answer Marks Unit

16 There can be more than one template argument. TRUE FALSE

Id Question A B C D Answer Marks Unit

17 Actual code for a template function is generated when the function declaration appears in the source code. the function definition appears in the source code. a call to the function appears in the source code. the function is executed at runtime. C 1 IV

Id Question A B C D Answer Marks Unit

18 An exception is typically caused by the programmer who writes an application‟s code. the creator of a class who writes the class member functions. a runtime error. an operating system malfunction that terminates the program. C 1 IV

B 1 IV

A 1 IV

Id Question A B C D Answer Marks Unit

19 Statements that might cause an exception must be part of a catch block. TRUE FALSE

Id Question A B C D Answer Marks Unit

20 Exceptions are thrown from the catch block to the try block. from a throw statement to the try block. from the point of the error to a catch block. from a throw statement to a catch block. D 1 IV

Id Question A B C D Answer Marks Unit

21 A statement that throws an exception does not need to be located in a try block. TRUE FALSE

Id Question A B C D Answer Marks Unit

22 The following is/are errors for which an exception would typically be thrown: An excessive amount of data threatens to overflow an array. new cannot obtain the requested memory. A power failure shuts down the system. A and B D 1 IV

Id Question A B C

23 Additional information sent when an exception is thrown may be placed in the throw keyword. the function that caused the error. the catch block.

B 1 IV

B 1 IV

D Answer Marks Unit

an object of the exception class. D 1 IV

Id Question A B C D Answer Marks Unit

24 A program can continue to operate after an exception has occurred. TRUE FALSE

Id Question

25 What is the output of following program?

A 1 IV

#include using namespace std; int main() { int x = -1; try { cout...


Similar Free PDFs