Quote:
Originally Posted by Zlebronjames
does anyone know how to use a try and catch function ? I need examples plz any C# program that has simple explain for it. Maybe I will use try and catch for calculation but I need to understand this function before I can do it.
hello try and catch blocks are use for handle exception art run time
error are two types compile time errors nad run time errors
when you have errors at compile time means spell mistake or any wrong statement
and while you are not sort out that errors you are not able to run your programme. But run time error isthat when you use such command which you are not difine for example
you difine a data in string formate and trying to calculate addition with another string or another dararype rhar is not possible and your programme will behave uncoditionaly and it teminate.but when you use try and carch block it prevent for uncoditionaly temination of programme and flash a message to user for the approriate reasone .if you want to know any other question you are mostwlcome