Exception Handling – MCQs

30 Score: 0 Attempted: 0/30 Subscribe
1. : What is the purpose of exception handling in C++?
 
2. : Which keyword is used to catch exceptions in C++?
 
3. : Which keyword is used to throw an exception?
 
4. : Which block must be used to enclose code that may throw an exception?
 
5. : What happens if an exception is not caught in C++?
 
6. : Which function is automatically called when no catch block handles an exception?
 
7. : Which type of error is best handled using exceptions?
 
8. : Can multiple catch blocks be used with one try block?
 
9. : What is the correct order of catch blocks?
 
10. : What does the ellipsis (…) in a catch block mean?
 
11. : What is the purpose of the try block?
 
12. : What does the throw keyword do?
 
13. : Which of the following is a standard exception class in C++?
 
14. : Which header file includes standard exception classes?
 
15. : Can user-defined types be thrown as exceptions?
 
16. : What is rethrowing an exception?
 
17. : Which exception is thrown when a new operator fails to allocate memory?
 
18. : What is the base class for all standard exceptions in C++?
 
19. : Can a constructor throw an exception?
 
20. : Is it possible to throw primitive data types as exceptions?
 
21. : What is the main benefit of exception handling?
 
22. : How many catch blocks can a single try block have?
 
23. : Which of the following can be caught using a catch block?
 
24. : What happens when throw is used without an operand inside a catch block?
 
25. : What type of exceptions does the standard exception class handle?
 
26. : Which exception class is used for invalid arguments?
 
27. : Can destructors throw exceptions in C++?
 
28. : What is noexcept used for in C++?
 
29. : Which keyword can be used to catch any type of exception?
 
30. : What will happen if you throw an exception inside a noexcept function?
 

Leave a Comment

All copyrights Reserved by MCQsAnswers.com - Powered By T4Tutorials