I have written a blog article some time ago, quickly summarizing the difference between Java generics and C++ templates which you may also be interested in: this blog post
The process of setting the type of the class template (in C++) or generic is called template specialization or generics specialization. From a first point of view generics and c++ templates may look very similar, but what's important is how the compiler translates it under the hood.
Java generics simply offer compile-time safety and eliminate the need for casts. They are implemented directly by the Java compiler as a front-end conversion, also known as type erasure. The compiler basically just erases all generic specifications (between the angle brackets) and inserts casts where necessary. Moreover it keeps track of the generics internally such that all instantiations will use the same underlying generic class at compile/run time. It is therefore somehow a process of code translation or rewriting.
A C++ template gets reproduced (code generation) and re-compiled entirely whenever a template is instantiated with a new class. This may have an impact onto performance.
Moreover potential errors are spotted at the last possible moment, at run-time when things are being used, i.e. when templates are being instantiated and used.
Java generics give you compile-time safety.