In the last lecture,we continued our discussion of Overriding
WithPolymorphism, a simple but powerful concept
Form 1 : Overriding Base Class Methods and Properties.
Form 2 : The Ability of Methods to Accept
And then illustrated with a generalizedMultiple-JTrainExample
That uses both
We also learned the basics of creating our own customCollections:
Similar to Collections.ArrayList, but defined by us
By inheriting from the .NET System Class,CollectionBase.
And defined our ownCollectioncalledJTrainCollection.
In this lecture, we first continue by updating Module1:
Add two utility Methods:
Update our Main()Method to use these withJTrainCollection
Then, we discussShared Members and Methods
Which allow us to share resources amongst all Object Instances.
Example (JFreightTrain) : A Shared WagonWeight Member