Multiple choice technology programming languages

try{ throw int;} catch (float) catch (double) catch (int) catch (long) catch (...)

  1. catch (float)

  2. catch (...)

  3. catch (int)

  4. catch (long)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Exception handlers are evaluated sequentially, and the first handler that matches the thrown exception type catches it. Since an int is thrown and catch(int) appears before catch(...), the int handler is selected. The catch(...) is a catch-all for any unmatched exception type.