继承修饰符(在类上)

继承

指定基类(或父类)

Public Class Person
End Class

Public Class Customer
    Inherits Person

End Class

'One line notation
Public Class Student : Inherits Person
End Class

可能的对象:

Dim p As New Person
Dim c As New Customer
Dim s As New Student

NotInheritable

阻止程序员将该类用作基类。

Public NotInheritable Class Person
End Class

可能的对象:

Dim p As New Person

为 MustInherit

指定该类仅用作基类。 (摘要课)

Public MustInherit Class Person
End Class

Public Class Customer
    Inherits Person
End Class

可能的对象:

Dim c As New Customer