--:--









Quiz for Custom exception classes

Course: C++ Language | Subject: Unit 10 | Topic: Exception Handling



Logo

Q1: What is the recommended base class for creating custom exceptions in C++?

Logo

Q2: Which method should be overridden in a custom exception class to provide error messages?

Logo

Q3: What should the what() method in a custom exception return?

Logo

Q4: Which C++ keyword is used to throw a custom exception?

Logo

Q5: How do you catch a custom exception in a try-catch block?

Logo

Q6: Can custom exception classes have additional members?

Logo

Q7: What is the benefit of using custom exceptions?

Logo

Q8: Which header file is required to create custom exceptions?

Logo

Q9: Is it necessary to catch custom exceptions explicitly?

Logo

Q10: What type should the destructor of a custom exception class have?

Logo

Q11: How to pass error details to a custom exception?

Logo

Q12: What is the typical return type of a custom exception constructor?

Logo

Q13: Can a custom exception class be caught by catch(...)?

Logo

Q14: What should you avoid in custom exception classes?

Logo

Q15: Can custom exceptions have member functions besides what()?

Logo

Q16: Is multiple inheritance allowed for custom exceptions?

Logo

Q17: Why override the what() method in custom exceptions?

Logo

Q18: What type does the what() method return?

Logo

Q19: Can custom exceptions be used with the noexcept specifier?

Logo

Q20: What is a common practice for storing error messages in custom exceptions?

Are you ready to start test? Set your time limit