Java uses type erasure which are very cheap in compile time but you cannot do things like
t = new T(); // T is a template parameter class
C++ uses reified generics which are heavy on compile time but allows the above.