The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Weblog:   Eye of the Tiger - Generics in J2SE 1.5
Subject:  Erasure
Date:  2003-12-04 07:36:03
From:  wgrosso
Response to: Erasure


Hi,

Where are you defining this? Keep in mind that when you download the new Generics compiler, you get the collection library, already genericized.

When the generics library was compiled, the type parameters were erased.

When your code is compiled, the type parameters in your code will be erased as well (and casts inserted). Compiling your code doesn't change the collections library. So

private ArrayList<String> foo;

will become an ArrayList, and when your code operates on foo, the appropriate casts will be inserted into your code.

Did I answer the question?


Bill

 Feed java.net RSS Feeds