Ways to improve Java Generics and dont say get rid of wildcards and reification.
Posted
by mP
on Stack Overflow
See other posts from Stack Overflow
or by mP
Published on 2010-03-27T10:56:24Z
Indexed on
2010/03/27
11:03 UTC
Read the original article
Hit count: 283
Sometimes i like to write up template classes and use type parameters to make the abstract methods more type safe.
Template<X> {
abstract void doStuff( X ); // NOT public
}
While type safety is great etc, the problem remains that even though X is not visible to outside code, one must still include the type to avoid warnings. My solution in this case would be to make it possible to define a scope for type parameters (now they are always public).
Would other original features besides the obvious would you like.
© Stack Overflow or respective owner