VB.Net Program to Overload Main() Function

You are currently viewing VB.Net Program to Overload Main() Function

VB.Net program to overload Main() function

'VB.net program to overload Main() function.

Module Module1
    Sub Main(ByVal val As Integer)
        Console.WriteLine("Val : {0}", val)
    End Sub
    
    Sub Main(ByVal val As Double)
        Console.WriteLine("Val : {0}", val)
    End Sub

    Sub Main(ByVal args As String())
        Main(10)
        Main(22.67)
    End Sub
End Module

Output

Val : 10
Val : 22.67
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply