Please always tell us where such quotes come from
, to avoid copyright problems, and so we can assess the sources. I am not convinced you have found a good source.
Erasure was used because otherwise generics would have broken old code; it generics had been introduced at the very beginning of Java®'s lifecycle, they would probaby have used reification.
No, type parameters are not replaced by anything in erasure; they are removed. An ArrayList wraps an Object
. So the runtime form of any List is the same as it would be for a List<Object>. It is not possible to replace the Object
by a T
, so all ArrayLists contain an Object