Finalize Objects : Finalize « Language Basics « VB.Net






Finalize Objects

Finalize Objects
Imports System

Public Class MainClass
    
    Shared Sub Main(ByVal args As String())
        Dim new_numbered As New Numbered()
    End Sub

End Class
  
    Public Class Numbered
        Public Sub New()
        End Sub

        Protected Overrides Sub Finalize()
            Console.WriteLine("Garbage collection started " )
        End Sub
    End Class

           
       








Related examples in the same category

1.Finalize - called when the object is removed from memoryFinalize - called when the object is removed from memory
2.Finalize ClassFinalize Class