level 1
Module Module1
Sub Main()
Dim obja As New a
Dim objb As New b
Dim objc As New c
Console.WriteLine(obja.xx)
Console.WriteLine(objb.xx)
Console.WriteLine(objc.xx)
Console.ReadLine() End Sub
End Module
//类a
Public Class a
Public Overridable Function xx() As String
Return "a"
End FunctionEnd Class
//类b
Public Class b
Inherits a
Public Overrides Function xx() As String
Return "b"
End Function
End Class
//类c
Public Class c
Inherits b
Public Overrides Function xx() As String
Return "c"
End Function
End Class
//输出结果
a
b
c
2011年11月02日 22点11分