(A) A function can throw an exception of certain type only
(B) A function can throw any type of exceptions
(C) A function can’t throw any type of exception
(D) A function can catch all types of exceptions
Category: C++ Programming Mcqs
C++ Programming Mcqs for Screening tests, Interviews, Viva and Other competitive exams. C++ Programming Mcqs section will help users to prepare mcqs of C++ Programming for various exams. Aspirants of Lecturer Computer Science, SST Computer Science, Subject Specialist Computer Science, Data Entry operator, Computer Programmer, Computer Operator, Software engineer and all other Competitive Exams can prepare their C++ programming portion from here.
Which statement is true about catch handler?
(A) It can have multiple parameters
(B) It must be placed immediately after try block T
(C) There must be only one catch handler for every try block
(D) None of the above
In nested try blocks if both inner and outer catch handlers are not able to handle the exception then:
(A) Program will be executed without any interrupt.
(B) Program will be terminated abnormally.
(C) Compiler executes only executable statements of main().
(D) Compiler issues compile time errors about it.
Throwing an unhandled exception causes standard library function to be invoked:
(A) aborted()
(B) stop()
(C) terminate()
(D) abandon()
Generic catch handler is represented by?
(A) catch(…)
(B) catch(—)
(C) catch(..,)
(D) catch(void x)
In nested try block if inner catch handler gets executed then:
(A) Outer catch handler will also get executed.
(B) Program execution stops immediately.
(C) Compiler will execute remaining executable statements of outer try block and then the main()
(D) None of the above
If inner catch handler is not able to handle the exception then:
(A) Program terminates abnormally
(B) Compiler will look for outer try handler
(C) Compiler will check for appropriate catch handler of outer try block
(D) None of the above
Irrespective of exception occurrence, catch handler will always get executed.
(A) True
(B) False