This is the last of my how to's, yes Jeff, Rob, Kathleen, et al, on
the use of shared with class variables, methods, properties, and
constructors.

Consider the following program:

Imports System.Console
Class TestClass1
' NOTE 1
'Public Shared Sub New()
'End Sub
' NOTE 2
'Overloads Shared Sub New()
'End Sub
'Overloads Shared Sub New (ByVal intArg As Integer)
'End sub
' NOTE 3
Shared Sub New()
WriteLine("New TestClass1")
End Sub
' NOTE 4
Public Overloads Shared Sub MyProc1()
End Sub
Public Overloads Shared Sub MyProc1(ByVal intArg As Integer)
End Sub
Public Overloads Shared Sub MyProc1(ByVal lngArg As Long)
End Sub
End Class
Class TestClass2
' NOTE 5
Public Overloads Sub new(ByVal lngArg As Long)
WriteLine("New TestClass2(lngArg)")
End Sub
' NOTE 6
Public Overloads Sub new(ByVal intArg As Integer)
WriteLine("New TestClass2(intArg)")
End Sub
End Class
Module Module1
Sub Main()
' NOTE 7
Dim TheClass1 As New TestClass1()
' NOTE 8
' Dim TheClass2 As New TestClass2()
' NOTE 9
Dim TheClass3 As New TestClass2(6)
' NOTE 10
Dim TheClass4 As New TestClass2(6L)
Dim TheClass5 As New TestClass2(CLng(6))
' NOTE 11
' TheClass3.New(7L)
End Sub
End Module

' NOTE 1
' A shared constructor cannot use the 'Public' specifier (error from
' the VB compiler)

' NOTE 2
' Cannot overload a constructor which is marked as 'Shared' (error
' from the VB compiler)

' NOTE 3
' A shared constructor cannot have any arguments (error from VB compiler)

' NOTE 4
' Shared methods may be overloaded but each must have a different
' parameter signature. ByRef vs ByVal does not constitute a
' difference.

' NOTE 5
' Non-shared constructors may be public. (see NOTE 1)

' NOTE 6
' Constructors may be overloaded but each must have a different
' parameter signature.

' NOTE 7
' When instantiating a class the uses a shared constructor, parameters
' are not permitted. (see NOTE 3)

' NOTE 8
' When instantiating a class with overloaded constructors, one of the
' overload's parameter signature must match the instantiating statement.
' In this case no parameterless signature is available.

' NOTE 9
' When instantiating a class with overloaded constructors, one of the
' overload's parameter signature must match the instantiating statement.
' In this case there appears to be 2 separate constructors that would
' work. Appearances are deceptive. The 6 argument is treated as an Integer.

' NOTE 10
' To invoke the other constructor the 6 must indicate that it is a long by
' using 6L or CLng(6) as the argument.

' NOTE 11
' A direct call to a constructor is allowd only as the first statment in
a
' constructor (error from VB Compiler). Even though the constructor is
a
' public method of the class it may not be directly invoked.

Output of this program is:

New TestClass1
New TestClass2(intArg)
New TestClass2(lngArg)
New TestClass2(lngArg)