Intro to Object Orientated Programming Part 5 - Simple Inheritance and Constructors

PlausiblyDamp

Staff member
Joined
Sep 4, 2002
Location
Lancashire, UK
User Rank
*Expert*
Guide to Object Orientated code in .Net

This is a continuation of the series started in here and is preceded by this thread

Introduction
So far we have looked at how we can define a class to encapsulate a simple business object and as part of this hide the internal details while providing a clean way for external code to utilise this class.
In this article we will look at a concept fundamental to OO development
 

PlausiblyDamp

Staff member
Joined
Sep 4, 2002
Location
Lancashire, UK
User Rank
*Expert*
  • Thread starter
  • Admin
  • #2
A Solution - Polymorphism
Notice how the SavingsAccount has a lot of methods in common with a BankAccount? More importantly in this case for a method like TransferMoney to work we only need these methods
 

Attachments

  • BankCS.zip
    7.3 KB · Views: 10
  • BankVB.zip
    6.9 KB · Views: 30
Last edited by a moderator:
Top