This will sound like a homework assignment, it sort of is, but isn't. Anyway!

I have created a simple address book application with a CSV backend.

This utilises a Person class to store the contacts details and an AddressBook class storing the list of Person.

Within the code we have to demonstrate:
- Polymorphism
- Inheritance
- Encapsulation

I have covered inheritance through the implementation of IEnumerable to allow for-each'ing through a list of People. Encapsulation is covered by using properties to allow access to private fields.

However I somewhere need to fit in an example use of Polymorphism which I'm failing to see how I can do with the current setup, and was looking for opinions as to where I could probably use it.

After starting a wonderful debate on StackOverflow I have picked on my implementation of IEnumerable and will bend that as polymorphism.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.