melbourne
2009-11-12 19:30:05 UTC
Public Sub New()
_month=string.empty
_day=String.empty
End Sub
Public Sub New (ByVal monthNum As String, ByVal dayNum As String)
Month=monthNum
Day=dayNum
End Sub
The second constructor (parameterized constructor) is called by Dim hireDate As New FormattedDate(monTextBox.Text, dayTextBox.Text) when the object 'hireDate' is created. My confusion is, the first default constructor seems never be called, then why bother being written? I see similar examples like above in my text book that both default and parameterized constructors are written in the Class, but only the parameterized constructor is called, do you must have the default one even if its not called?