.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson

Home >> Code Snippets >> Bugs & Resolutions >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Catch exception raise by System.OverflowException.

Posted By:shiv chandra       Posted Date: June 30, 2011    Points: 40    Category: Bugs & Resolutions    URL: http://www.dotnetspark.com  

Catch exception raise by System.OverflowException.

// Maximum Limit of Short integer.
short shorty = 32767;                   
int integer = shorty + 1;

    // force compiler to object
        // try to cast it into a short
        shorty = (short)integer; 
catch (OverflowException e)
    //"Arithmetic operation will raise overflow error."


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend