C
Chris Smith
I don't see how this is lost. Type erasure refers to generics info
being lost after compile finishes, right? Type erasure does not effect
the number of generated compiler warnings.
Generics without type erasure would allow the Java virtual machine at
runtime to check the correctness of casts to generic types. That would
eliminate the need for the compiler to generate an unchecked cast
warning at compile time.
Can you be more specific, please.
Sure. There are 65 examples in the core Java API. Search
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/class-use/Class.html
for the string "Class<T>". None of these parameters should be
necessary. (To be fair, sometimes the actual parameter serves to
disambiguate the method, and prevents the need to specify explicit type
parameters; but specifying an explicit type parameter would be clearer
and more consistent.)
I do not see what you are referring to. Maybe we mean very different
things by "type erasure".
No, we don't. I'm just talking about the consequences of type erasure,
whereas you seem to be limiting your consideration to the definition
itself. For example:
Regardless of "type erasure" or .... "type retention" the paramters,
signatures, documentation of methods would not change.
Of course it would be POSSIBLE to define methods with all the same
parameters they have now. It just wouldn't be sensible. There would be
better ways to do it.
Can you list a
handful of methods that take "Class<T>" as a paramter?
See above.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation