Overloads function : Overloaded functions « Class Module « VB.Net Tutorial






public class Test
   public Shared Sub Main

        Console.WriteLine(Min(10.1, 10))
        Console.WriteLine(Min("last", "first"))
        Console.WriteLine(Min(#1/1/2000#, #3/4/2000#))
   End Sub
    Overloads Shared Function Min(ByVal dblA As Double, ByVal dblB As Double) As Double
        Min = IIf(dblA < dblB, dblA, dblB)
    End Function

    Overloads Shared Function Min(ByVal strA As String, ByVal strB As String) As String
        Min = IIf(strA < strB, strA, strB)
    End Function

    Overloads Shared Function Min(ByVal dteA As Date, ByVal dteB As Date) As Date
        Min = IIf(dteA < dteB, dteA, dteB)
    End Function


End class
10
first
01/01/2000 12:00:00 AM








6.9.Overloaded functions
6.9.1.Overloads function
6.9.2.Using overloaded methods
6.9.3.Using overloaded methods to print arrays of different types
6.9.4.Method Overloads with different number of parameters
6.9.5.Inheritance and overloads