Runtime type information Generic Classes

M

marcwentink

I am reading some information on generic (typed) collections and own
created generic classes in Java 5. I have understood that in the new
typed collections, the 'type' is only a compile time feature, it is
stripped from the collections like ArrayList in the intermediate code.
But if I generate my of generic typed class, is this information
stripped aswell, or is the first only something special for
collections to make them work with Java 4 'Object type' collections?

Marc Wentink
 
C

Chris Dollin

I am reading some information on generic (typed) collections and own
created generic classes in Java 5. I have understood that in the new
typed collections, the 'type' is only a compile time feature, it is
stripped from the collections like ArrayList in the intermediate code.

Yes: `type erasure`.
But if I generate my of generic typed class, is this information
stripped aswell,

Yes.

Is that important to you?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top