Linked by Tony Steidler-Dennison on Thu 10th Jul 2008 13:39 UTC, submitted by BlueVoodoo
Java Wildcards can be very confusing when it comes to generics in the Java language, and one of the most common mistakes is to fail to use one of the two forms of bounded wildcards ("? super T" and "? extends T") when needed. You've made this mistake? Don't feel bad, even the experts have, and this month Brian Goetz shows you how to avoid it.
Thread beginning with comment 322373
To read all comments associated with this story, please click here.
what about
by renhoek on Thu 10th Jul 2008 18:14 UTC
renhoek
Member since:
2007-04-29

just don't go to wild :
* List<int> primitive;
* List<Integer> array[];
* if (T instanceof String) {}
* function(List<Integer>.class);

and i have a lot of other trouble because of the type erasure. so kids, just say no and wait for the proper implementation. java generics are nothing but a fancy way to remove the casting.

Reply Score: 2