Templates in C++ or the generic types from Haskel enable parametric polymorphism which is a lot more elegant for certain problems than subtype-polymorphism (i.e. OOP).
Java's generics is only a hack to make it look as though some piece of code that's using subtype-polymorphism is parametric ... but it only saves you explicit type-casts, which are also useless.
dotNet's generics are different ... while sharing the same limitations (i.e. no late binding and not implicit interfaces), because the types are available at runtime the runtime dispatches being made aren't just hacks and you can use the reflection mechanism to workaround many of the problems associated.
I am rewriting a C# app in Java right now and I'm being forced into extremely awful hacks to prevent memory consumption from exploding. To illustrate how bad the situation is let me tell you that I'm seriously thinking about rewriting everything in C++ :-)
T obj;
obj = getObjFromSomewhere();
log(T.class);
This type of operation is most useful if writing framework type of some sort. I've come across it when trying to write a generic JPA base DAO type of class.http://www.scala-blogs.org/2008/10/manifests-reified-types.h...
It's improved a bit in 2.8 - in porting some code I discovered a nice little hack that lets you declare your variance like this:
[A <: SomeBaseClass <: Manifest]
Which tells the compiler in an oh so gentle manner to reify for you.