Lecture overview -- Keyboard shortcut: 'u'  Previous page: Sample use of class <b><kbd>Collection<T></kbd></b> -- Keyboard shortcut: 'p'  Next page: Specialization of Collections - a realistic example -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Collection Classes - slide 10 : 36

Specialization of Collections

I want to make my own specialized/extended collection.
Which class should be selected as superclass of my collection class?

The class constructed from Collection<T> is a useful starting point

animal.cs
A class Animal.
farm.cs
A class AnimalFarm - a subclass of Collection<Animal> - testing protected members.
prog.cs
A sample client of AnimalFarm - revealing use of protected Collection<Animal> methods.
output
Output from sample client of AnimalFarm.