OverflowException Class : Exception System « Development « VB.Net






OverflowException Class

 

Imports System
Imports Microsoft.VisualBasic

Module MainClass

    Sub Main( )        
        Dim value As Integer = 780000000
        Try
           ' Square the original value.
           Dim square As Integer = value * value 
           Console.WriteLine("{0} ^ 3 = {1}", value, square)
        Catch e As OverflowException
           Dim square As Double = Math.Pow(value, 2)
           Console.WriteLine("Exception: {0} > {1:E}.", _
                             square, Int32.MaxValue)
        End Try
    End Sub 
End Module

   
  








Related examples in the same category

1.Use Argument ExceptionUse Argument Exception
2.Parse Number ExceptionParse Number Exception
3.ArgumentException Class