overrideb.vb

来自「大名鼎鼎的mono是.NET平台的跨平台(支持linux」· VB 代码 · 共 36 行

VB
36
字号
Option Strict OffClass B    Overridable Function F() As Integer        Return 5    End FunctionEnd ClassClass D    Inherits B    Overrides Function F() As Integer        ' you should be able to access         ' the members of base class         ' using 'MyBase' as follows        MyBase.F()        Return 10    End FunctionEnd ClassModule OverrideA    Function Main() As Integer        Dim x As Object        x = New B()        If x.F() <> 5 Then            System.Console.WriteLine("#A1, unexpected result from base class") : Return 1        End If        x = New D()        If x.F() <> 10 Then            System.Console.WriteLine("#A2, unexpected result from derived class") : Return 1        End If    End FunctionEnd Module

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?