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.