O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 19

Answers to Chapter 19 Review Questions

1: List three examples of typical exceptions.
A1: Dividing by zero, running out of memory, accessing a non-existent file.
2: What are the advantages of handling exceptions with try-catch-finally?
A2: The normal case code and exception handling code can be kept separate. Exceptions can be handled gracefully without exposing the end user to cryptic looking code.
3: Which class is at the top of the exceptions class hierarchy?
A3: System.Exception
4: How many catch and finally blocks can be attached to a try block?
A4: Zero, one or many catch blocks, and zero or one finally block. However, at least one block (it can either be a catch or a finally block) must be attached to a try block.
5: What happens to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required