Still have no online help as it is coming to 3 weeks withou my own laptop
So I have come across this and hope someone can enlighten me.
My book says that the above ensures that the New method of class clsVehicle is called by using MyBase.
Yep makes sense until I see and read something like this;
I've lost the plot now?
what of MyBase or Overloads or or ??
So I have come across this and hope someone can enlighten me.
Visual Basic:
Public Class clsCar
Inherits clsVehicle
sub new()
End Class
Visual Basic:
Sub New()
MyBase.New(some guff goes here)
End Sub
My book says that the above ensures that the New method of class clsVehicle is called by using MyBase.
when a child class defines a method that already exists in the base class, any object created from the child class will call the code in the method of this class, unless we explicitly call the base class method as above.
Yep makes sense until I see and read something like this;
Visual Basic:
Public Class clsCar
Inherits clsVehicle
sub New()
Shadows Sub Drive()
End Class
The keyword shadows helps the developer to extend base classes in a more flexible way, allowing the child class to block any methods with the same name defined in the base class, even if they have different parameters. In the preceeding example, if we had defined method Drive without the shadows keyword we would have two different Drive methods in the clsCar class.
I've lost the plot now?
what of MyBase or Overloads or or ??