Public Class Numbered
Private m_Number As Integer
Public Sub New(ByVal my_number As Integer)
m_Number = my_number
End Sub
' Garbage collection started.
Protected Overrides Sub Finalize()
Console.WriteLine("Finalize Number: " & m_Number)
End Sub
End Class
public class Test
public Shared Sub Main
Dim new_numbered As New Numbered(1)
new_numbered = New Numbered(2)
End Sub
End class
|