VB.Net Tutorial/Class Module/Inherits — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 15:55, 26 мая 2010

"Inherits" must be first line. There can be only one

<source lang="vbnet">Public Class Person

   Inherits System.Object
   Public Name As String
   Public Birthday As Date

End Class Public Class Student

   Inherits Person 
   Public Sub New(ByVal StudentName As String, ByVal BirthDate As Date)
       MyBase.Name = StudentName
       MyBase.Birthday = BirthDate
   End Sub
   Public StudentID
   Public Overrides Function ToString() As String
       Return (Me.Name)
   End Function

End Class</source>