What are some good example classes for introducing generics in Java?
I'm introducing this in the context of implementing ArrayList
, but I don't want my first example to be ArrayList
itself due to the inability to create arrays of a generic type. I would also like my example to be something that doesn't seem contrived/has a practical use.