Chapter 6. Managing Errors and Exceptions
After completing this chapter, you will be able to:
Handle exceptions by using the try, catch, and finally statements.
Control integer overflow by using the checked and unchecked keywords.
Raise exceptions from your own methods by using the throw keyword.
Ensure that code always runs, even after an exception has occurred, by using a finally block.
You have now seen the core Microsoft Visual C# statements you need to know to read and write methods; declare variables; use operators to create values; write if and switch statements to run code selectively; and write while, for, and do statements to run code repeatedly. However, the previous chapters haven’t considered the possibility (or probability) that things ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access