Sunday, July 20, 2008

Constructors and Destructors With VB.Net

Public Class Class1

Public w As Integer

'==== Constructors ====

Public Sub New(ByVal x As Integer)

w = x

MsgBox("this Is The Costructors")

End Sub

'==== Destructors ====

Protected Overrides Sub Finalize()

MsgBox("this Is The Destructors")

End Sub

End Class



To create Object :

Dim x As New Class1(10)


Download Example (Vb.net 2008)

No comments: