()在同一个文件中创建另一个类Car:
Public Class Car
Inherits Vehicle
Public Sub New()
_wheels =
_topSpeed =
_warningSound = Honk
End Sub
End Class
()现在再创建另一个类Bike:
Public Class Bike
Inherits Vehicle
Public Sub New()
_wheels =
MyBaseTopSpeed =
_warningSound = Ring Ring
End Sub
End Class
()继续创建另一个类Skateboard:
Public Class Skateboard
Inherits Vehicle
Public Sub New()
_wheels =
_topSpeed =
End Sub
Public Overrides Function Warning() As String
Return No warning youll have to shout yourself
End Function
End Class
在End Sub和End Class之间输入以下代码
Public Overrides
现在按下空格键可以看到弹出了一个小小的帮助提示
[] [] [] [] [] []