WriteLine(two.add(10))
'calls the function with one argumentWriteLine(two.add(10, 20))
'calls the function with two argumentsWriteLine(two.add(10, 20, 30))
'calls the function with three argumentsRead()
End SubPublic Class One Public i, j, k As Integer Public Function add(ByVal i As Integer) As Integer 'function with one argument Return i End Function Public Function add(ByVal i As Integer, ByVal j As Integer) As Integer 'function with two arguments Return i + j End Function Public Function add(ByVal i As Integer, ByVal j As Integer, ByVal k As Integer) As Integer 'function with three arguments Return i + j + k End Function End Class
OutPut:
10
30
60
No comments:
Post a Comment