home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic .NET - Read Less - Learn More / Visual_Basic.NET_Read_Less_Learn_More_Richard_Bowman_Visual_2002.iso / Resources / Code / Ch8-OverloadAMethod / Module1.vb < prev   
Text File  |  2001-08-08  |  506b  |  18 lines

  1. Public Class Math
  2.     Public Overloads Function Add(ByVal x As Integer, _
  3.             ByVal y As Integer) As Integer
  4.         Return x + y
  5.     End Function
  6.     Public Overloads Function Add(ByVal x As Single, _
  7.             ByVal y As Single) As Single
  8.         Return x + y
  9.     End Function
  10. End Class
  11. Module Module1
  12.     Sub Main()
  13.         Dim math As New Math(), n As Integer = 5, m As Integer = 10
  14.         Console.WriteLine(math.Add(n, m))
  15.         Console.ReadLine()
  16.     End Sub
  17. End Module
  18.