C++ | Exception Handling | Question 6
#include <iostream> using namespace std; int main() { try { throw 10; } catch (...) { cout << "default exception\n"; } catch (int param) { cout << "int exception\n"; } return 0; } |
chevron_right
filter_none
(A) default exception
(B) int exception
(C) Compiler Error
Answer: (C)
Explanation: It is compiler error to put catch all block before any other catch. The catch(…) must be the last catch block.
Quiz of this Question
Recommended Posts:
- C++ | Exception Handling | Question 10
- C++ | Exception Handling | Question 4
- C++ | Exception Handling | Question 3
- C++ | Exception Handling | Question 7
- C++ | Exception Handling | Question 5
- C++ | Exception Handling | Question 8
- C++ | Exception Handling | Question 1
- C++ | Exception Handling | Question 12
- C++ | Exception Handling | Question 11
- C++ | Exception Handling | Question 2
- C++ | Exception Handling | Question 9
- Java | Exception Handling | Question 6
- Java | Exception Handling | Question 3
- Java | Exception Handling | Question 8
- Java | Exception Handling | Question 7



