July 2015
Intermediate to advanced
1300 pages
87h 27m
English
The previous section discussed the MyBase keyword and how it can be used to access members from a base class. The keyword also has another important purpose when it comes to constructors. Consider the following constructor, which is implemented within the Person class (that is, the base class) shown in the previous section:
Public Sub New(firstName As String, lastName As String, age As Integer) Me.FirstName = firstName Me.LastName = lastName Me.Age = ageEnd Sub
The problem now is in derived classes. The rule is that if you have a constructor receiving arguments in the base class, you do need to provide a constructor receiving arguments also within a ...