"Sub New" in a class?

FlyBoy

Well-known member
Joined
Sep 6, 2004
Messages
106
i have this:
Public Class Customer

Private _ID As Integer

Public Sub New(ByVal id As Integer)

Me.ID = id
End Sub

Public Property ID() As Integer
Get
Return Me._ID
End Get
Set(ByVal Value As Integer)
Me._ID = Value
End Set
End Property


my question is,what the sub new is for?
its not a property or a method,so basically what it does???
(is it a built in something like "sub main" in modules?)
 
The Sub New is what is refered to as a constructor, it allows you to pass in information to a class at the point of instantiation.

You may find this useful.
 
PlausiblyDamp said:
The Sub New is what is refered to as a constructor, it allows you to pass in information to a class at the point of instantiation.

You may find this useful.

got that! thanks!!!! :cool: ;)
 
Back
Top