Implement the concept of Overloading in a Console Application.

CODE:

Base1.vb:

Imports System.Console

Public Class base1

Public Function ABC(ByVal disp As String)

WriteLine("String Function" & ControlChars.NewLine & disp)

Return 0

End Function

Public Function ABC(ByVal disp As Integer)

WriteLine("Integer Function" & ControlChars.NewLine & disp)

ReadLine()

Return 0

End Function

End Class

Module1.vb:

Module Module1

Sub Main()

Dim b As New base1

b.ABC("ABCD")

b.ABC(1001)

End Sub

End Module

No comments:

Post a Comment