Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java generics

Name: Anonymous 2007-01-25 3:56

I'm having a really hard time using generics in Java. Why are they so damn confusing? Real generics aren't this hard. Can someone break this down and explain this to me?

Name: Anonymous 2011-12-31 9:52

1. Java generics are somewhat limited but they are slowly walking towards C# generics which are more permissive.
2. Type safety is considered a good thing by Java/C# programmers.
3. You cannot instantiate a generic type with int (List<int>) because int is a value type, or whatever you want to call it, you need to use the int wrapper class Integer. Wrapper classes or type boxing is not done automatically as it is in C# (this might be a good thing, since it has a cost and at least forces programmers to face potential efficiency issues).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List