Lecture overview -- Keyboard shortcut: 'u'  Previous page: Specialization of Collections -- Keyboard shortcut: 'p'  Next page: Overview of the class <b><kbd>List<T></kbd></b> -- 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 11 : 36

Specialization of Collections - a realistic example

An AnimalFarm class with auto insertion of animals of opposite sex

An AnimalFarm class in which removal and clearing is denied

An AnimalFarm class that extends Collection<Animal> with GetGroup

animal.cs
The class Animal - Unchanged.
farm.cs
The class AnimalFarm - a subclass of Collection<Animal>.
prog.cs
A sample client of AnimalFarm.
output
Output from sample client of AnimalFarm.