Overloading
How can be overload a method?? Please help meh out with this
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Datta KharadPosted Dec 26, 2011, 6:59 AM
Refer this link...
http://www.c-sharpcorner.com/Forums/Thread/152484/overlaoding.aspx
Satyapriya NayakPosted Dec 26, 2011, 1:52 AM
Overloading: - It is a process of using several procedures with the same name but having different signatures. The signature changes in number of parameters, type of parameter, and order of parameter.
Program
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
raj()
raj(2)
raj(3, 3)
raj("ravi", 1)
raj(100, "rahul")
End Sub
Public Overloads Sub raj()
MsgBox("Hello Raj")
End Sub
Public Overloads Sub raj(ByVal x As Integer)
MsgBox(x * 5)
End Sub
Public Overloads Sub raj(ByVal x As Integer, ByVal y As Integer)
MsgBox(x + y)
End Sub
Public Overloads Sub raj(ByVal s As String, ByVal x As Integer)
MsgBox(s & ":has achieved rank" & x)
End Sub
Public Overloads Sub raj(ByVal x As Integer, ByVal s As String)
MsgBox(s & ":has secured" & x)
End Sub
End Class
Thanks
AartiPosted Dec 26, 2011, 1:51 AM
Method Overloading: - Same Function name and return type having different Signature.
for example: