Show the syntax (the general form) of a try…catch pair.

What will be an ideal response?


try
{
// Any number of statements;
// some might cause an exception
}
catch(XxxException anExceptionInstance)
{
// Do something about it
}
// Statements here execute whether there was an exception or not
where XxxException represents the Exception class or any of its more specific subclasses and is the data type of the anExceptionInstance object.

Computer Science & Information Technology

You might also like to view...

Explain why consistency is a threat to the operation of networks.

What will be an ideal response?

Computer Science & Information Technology

Which is not a typical application of queues?

a. Routing packets in a computer network. b. File server handling file access requests from many clients. c. High-speed sorting. d. Print spooling.

Computer Science & Information Technology

Can you think of some examples of sites or apps that you find frustrating but still use? Why do you stick with them?

What will be an ideal response?

Computer Science & Information Technology

Within Microsoft Outlook, more than two dozen items of information called ________ can be used to sort e-mail messages

Fill in the blank(s) with correct word

Computer Science & Information Technology