'抽象類別 有一定子類別 Public MustInherit Class Employee 'Data Field Protected _id As String Protected _name As String Protected _salary As Decimal '建構子 Public Sub New() End Sub 'OverLoading建構子 Public Sub New(ByVal _id As String, ByVal _name As String) Me._id = _id Me._name = _name End Sub Public Property Id() As String Get Return _id End Get Set(ByVal value As String) Me._id = value End Set End Property Public Property Name() As String Get Return Me._name End Get Set(ByVal value As String) Me._name = value End Set End Property '薪資計算(有寫像沒寫 子類別都不用) '定結構 不寫本體-描述成抽象method Public MustOverride Sub calSalary(ByVal b As Decimal) End Class
from
http://www.dotblogs.com.tw/timothy/archive/