Imports System
Imports System.Collections
Public Class MainClass
Shared Sub Main(ByVal args As String())
Try
Throw New ObjectExpiredException("This object has expired.")
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Sub
End Class
Public Class ObjectExpiredException
Inherits System.ApplicationException
' No parameters. Use a default message.
Public Sub New()
MyBase.New("This object has expired")
End Sub
' Set the message.
Public Sub New(ByVal new_message As String)
MyBase.New(new_message)
End Sub
' Set the message and inner exception.
Public Sub New(ByVal new_message As String, ByVal inner_exception As Exception)
MyBase.New(new_message, inner_exception)
End Sub
End Class
|