December 2001
Beginner
976 pages
22h 4m
English
There are some cases in which the base class of an inheritance hierarchy needs to declare an overridable method, but the class itself is unable to provide any implementation for the method. In this case what you need is a way to force the derived classes to override the method in discussion. For an example, let's consider a banking application that has an Account base class, of which you derived two classes: CheckingAccount and SavingsAccount. We illustrate these three classes as follows.
Public Class Account Protected m_balance As Decimal Public Property balance() As Decimal Get Return m_balance End Get Set m_balance = value End Set End Property Public Sub New(Optional ByVal startBalance As Decimal = 0) m_balance = startBalance ...
Read now
Unlock full access