4 ms·
Generics don't solve the TypeDef problem. It's the old, I am probably never going to need anything over 2 billion, but I am not 100% sure.
by Retric 9y ago
Generics don't solve the TypeDef problem. It's the old, I am probably never going to need anything over 2 billion, but I am not 100% sure.
- AstralStorm 9y agoGeneric method syntax is both much more limited and more complex... Foo<? super Bar extends Madness> with various insane limitations. Makes C++ SFINAE seem elegant...
- foota 9y agoI was talking about the following: "Now, in Java, if you use a data container provided by the language, you are forced to upcast all the time." Which is solved by generics.
- Retric 9y agoLast I checked, if you store an int in a generic it get's converted to an object which takes more memory to store. So, the syntax is similar, but the actual behavior is not because int's can't be null, but Integers can for example. This costs 8 ish bytes of memory.
- foota 9y agoThat is true. It looks like there is some work being done to potentially relax this constraint, http://openjdk.java.net/jeps/218 http://openjdk.java.net/jeps/218