Runtime type information Generic Classes

Discussion in 'Java' started by marcwentink@hotmail.com, Mar 14, 2007.

  1. Guest

    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
    , Mar 14, 2007
    #1
    1. Advertising

  2. Chris Dollin Guest

    wrote:

    > 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?

    --
    Chris "electric hedgehog" Dollin
    Nit-picking is best done among friends.
    Chris Dollin, Mar 14, 2007
    #2
    1. Advertising

  3. Guest


    > Is that important to you?



    No, not really important, I was just curious.
    Thank you for the information.
    , Mar 15, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. clercmedia
    Replies:
    2
    Views:
    32,286
    clercmedia
    Dec 9, 2005
  2. Terence Wilson
    Replies:
    4
    Views:
    353
    Thomas J. Gritzan
    May 11, 2007
  3. lerenard001
    Replies:
    0
    Views:
    423
    lerenard001
    Jul 7, 2008
  4. lerenard001
    Replies:
    0
    Views:
    472
    lerenard001
    Jul 9, 2008
  5. minlearn
    Replies:
    2
    Views:
    454
    red floyd
    Mar 13, 2009
Loading...

Share This Page