User:Mukeshnt/CSharp Exceptions

Compile-time and Run-time errors?

Compile-time errors: (i)	These errors are detected at the time of compiling a C# program. (ii)	Syntax errors lead to compile time errors. (iii)	If a compile-time error occurs the .cs file is not created. (iv)	The error must be removed before the program can be compiled again. (v)	Most common compile-time errors are due to typing mistakes. Examples of such errors are: •	Missing braces •	Missing semicolon •	Use of undeclared variables •	Type mismatch errors •	Missing double quotes in strings •	Use of = operator instead of the == operator •	Incorrect spelling of variable names or other identifiers.

Run-time errors: These errors appear when the program is run. (i)	These errors are detected only when a program is run. (ii)	These errors cannot be detected by a compiler. (iii)	These errors can be due to wrong logic. (iv)	Common run-time errors are: •	Division by zero error. •	Attempting to access an array element that is out of bounds. •	Passing an invalid parameter (i.e., incorrect data type) •	Converting an invalid string to a number, or vice-versa. •	Trying to store a value into an array of incompatible data type. •	Trying to use a negative size of an array.