Explain how the mechanism for deciding which catch block catches an exception is like the mechanism for deciding which function definition is used when an overloaded function is called.
What will be an ideal response?
```
try
{// code to throw one of the several exceptions below
}
catch (int e)
{// handle the int exception
}
catch(string e)
{// handle the string exception
}
catch(MyException obj)
{// handle MyException
}
```
The mechanism for selecting the proper catch block is exactly the same as the
mechanism for choosing among overloaded functions, except that the type match
must be exact, or no exception will be caught. While the order of the catch blocks can
affect which catch block is executed, the order does not affect the selection of a
function overloading.
You might also like to view...
____ is an open source video format.
A. QuickTime B. RealVideo C. Theora D. Windows Media Video
Which of the following statements accurately describes fingerprint recognition?
A. fingerprint recognition is unhealthy B. fingerprint recognition is rarely used C. fingerprint recognition is easily deceived D. fingerprint recognition scanners are very expensive
To move up one paragraph, press the ____ key(s).
A. F1 B. ALT+UP ARROW C. UP ARROW D. CTRL+UP ARROW
How would you convert the contents of a file to uppercase?
What will be an ideal response?