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

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.