Finally always executes : Finally « Development « VB.Net Tutorial






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








7.7.Finally
7.7.1.Try Catch with Finally clause
7.7.2.Finally always executes
7.7.3.Close Stream in Finally statement
7.7.4.Finally after multiple catch statements