 For container classes, for example, this is a problem because there is no easy way to create a container that accepts only specific types of objects.Either the container operates on all subtypes of a class or interface, usually codice_33, or a different container class has to be created for each contained class.Generics allow compile-time type checking without having to create many container classes, each containing almost identical code.