When two different types of data are used for addition calculation, an exception handling statement is used to capture exceptions due to data type errors and generate errors. Continue and run the previous generation successfully ?, SQL statement Addition
1 using System; 2 using System. collections. generic; 3 using System. linq; 4 using System. text; 5 6 namespace Test06 7 {8 class Program 9 {10 static void Main (string [] args) 11 {12 try13 {14 int a = 1; 15 ulong B = 5; 16 int c = a + B; 17 Console. writeLine (c); 18 Console. readLine (); 19} 20 catch (Exception ex) 21 {22 Console. writeLine (ex. message); 23 Console. readLine (); 24} 25} 26} 27}
Failed to execute as expected, but found "a generation error occurred. Whether to continue and run the previous generation successfully. "find out the problem.
After understanding it, I got a preliminary conclusion: the compilation code is not passed, let alone the execution,
Therefore, exception handling refers to an exception in program execution. After a corresponding exception occurs, an exception is displayed.
Thank you for your criticism!