Simple, Quality, Awesome Software

Generics Quiz

Below are the answers to the Generics Quiz, along with a brief discussion.

1. Generics allow you to create classes that are type safe, without needing to commit to specific types in the declaration.

2. List strings = new List();

3. You use angle brackets. public class AmazingClass { /* ... */ }

4. False. Generic classes can have any number of generic type parameters.

5. True.

6. True.