© Ali Asad and Hamza Ali 2017

Ali Asad and Hamza Ali, The C# Programmer’s Study Guide (MCSD), 10.1007/978-1-4842-2860-9_9

9. Exception Handling and Validating Application Input

Ali Asad and Hamza Ali1

(1)Sialkot, Pakistan

Introduction to Exception

Exception is an unexpected error that occurs at runtime (when an application is running). Sometimes a programmer doesn’t know what and which exception could occur at runtime. For example, the code is reading a file but the file is missing from the location where it is read. It is accessing or reading data across the network but the Internet is not available, or it is loading some kind of data in memory but the system runs out of memory, etc. In all these cases, programmers write the code right but, due ...

Get The C# Programmer’s Study Guide (MCSD): Exam: 70-483 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.