Mega Code Archive

 
Categories / VB.Net Tutorial / Development
 

Finally always executes

Public Class Tester     Public Shared Sub Main          DoesNotThrowException()     End Sub    Public Shared Sub DoesNotThrowException()       Try          Console.WriteLine("In DoesNotThrowException")       Catch          Console.WriteLine("This Catch never executes")       Finally          Console.WriteLine("Finally executed in DoesNotThrowException")       End Try       Console.WriteLine("End of DoesNotThrowException")    End Sub ' DoesNotThrowException End Class In DoesNotThrowException Finally executed in DoesNotThrowException End of DoesNotThrowException