Why don't Generics support primitive types?

Posted by RayAllen on Stack Overflow See other posts from Stack Overflow or by RayAllen
Published on 2010-04-27T13:24:17Z Indexed on 2010/04/27 14:03 UTC
Read the original article Hit count: 253

Filed under:
|
|

Why Generics (in Java) works with the objects but not with primitive types?

For example

Gen<Integer> inum = new Gen<Integer>(100); // works fine, but  
Gen<int> inums = new Gen<int>(100); // is not allowed.   

Thanks !

© Stack Overflow or respective owner

Related posts about java

Related posts about generics