我有一個基類foo
將在相似但略有不同功能的多個子類中使用的內部函數:VB.NET:聲明一個基類非重寫
Public MustInherit Class foo
Public Function bar1() as Something
''// Perfectly OK to change what this method does
End Function
Public Function bar2() as Something
''// Does a very specific thing I don't want changed ever,
''// but this function must be inherited
End Function
End Class
如何獲得編譯器生成一個錯誤,當bar2()
被子類覆蓋?
這是那些日子之一......非常感謝你。 – 2010-08-05 21:34:27
@Heather沒問題:) – Andy 2010-08-06 11:16:31