3 ms·
I 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 solve
by foota 9y ago
I 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