如果我有一個名爲A的類和一個名爲B的類,如果B繼承了A,那意味着A是超類,B是子類。我被要求描述爲什麼A類不是一個抽象類,但是因爲我看到A類是一個抽象類A,因爲它已經爲B類在未來使用而創建,它與B類不是關係能夠訪問類A中的字段,儘管它們默認爲私有的?VB.net抽象類理解
A類看起來像這樣
Public Class A
StartDate As Date
Men As Integer
Place As String
Public Sub New()
StartDate = Today
Men = 0
Place = ""
End Sub
End Class
B類貌似這個
Public Class B inherits Class A
Grade As ExamGrade
Public Sub New()
MyBase.New
StartDate = Today
Men = 0
Place = ""
Grade = 'Easy'
End Sub
Public Function setGrade(grade As String)
ExamGrade = grade
End Function
End Class
的[這](http://en.wikipedia.org/wiki/Abstract_type)維基百科可能會給你一個提示,一個很大的區別 –