Consider pulling an element out of a list in Java. When the next() method is called, the object needs to be cast to the appropriate type. If the type is not correct, this will not usually be realised until runtime. Generics in Java allow us to tell the compiler what type of object to expect, catching type mismatch errors at compile time.
The implementation of Generics in Java is a highly contovertial topic. Generics are implemented only at high level Java source and not in the JVM byte code. Generics are converted to non generics by the compiler.