Interface Speak
Sub GoodMorning()
Sub GoodEvening(ByVal CurrentDate As DateTime)
End Interface
Class English
Implements Speak
Public Sub GoodMorning() Implements Speak.GoodMorning
Console.WriteLine("Good morning!")
End Sub
Public Sub GoodEvening(ByVal CurrentDate As DateTime) Implements Speak.GoodEvening
Console.WriteLine("Good evening -- it is now " & CurrentDate)
End Sub
End Class
Class Spanish
Implements Speak
Public Sub GoodMorning() Implements Speak.GoodMorning
Console.WriteLine("Buenos Dias!")
Console.WriteLine(Now())
End Sub
Public Sub GoodEvening(ByVal CurrentDate As DateTime) Implements Speak.GoodEvening
Console.WriteLine("Buenas noches -- La fetcha y hora son " & CurrentDate)
End Sub
End Class
Module Module1
Sub Main()
Dim Hello As New English()
Dim Hola As New Spanish()
Hello.GoodMorning()
Hello.GoodEvening(Now())
Hola.GoodMorning()
Hola.GoodEvening(Now())
End Sub
End Module
|