Imports System
Public Class MainClass
Shared Sub Main()
Dim i As Integer = 5
Console.WriteLine("The value of i is: {0}", i.ToString( ))
Dim milo As New Dog(62)
Console.WriteLine("My dog Milo weighs {0} pounds", milo.ToString( ))
End Sub
End Class
Public Class Dog
Private weight As Integer
Public Sub New(ByVal weight As Integer)
Me.weight = weight
End Sub 'New
Public Overrides Function ToString( ) As String
Return weight.ToString( )
End Function 'ToString
End Class 'Dog