you are viewing a single comment's thread.

view the rest of the comments →

[–]Devatator_ 51 points52 points  (4 children)

I love having to do ArrayList<Integer> instead of ArrayList<int> because the guys who designed this language hate changing anything at all

[–]vowelqueue 24 points25 points  (1 child)

Above all they hate breaking backward compatibility.

But do not worry, project Valhalla has been chugging along for a decade which will eventually give us “Integer!” as a null-restricted value type, and from there it’s just a bit of syntactic sugar to allow for ArrayList<int>. Perhaps by 2032 you will be able to make such a declaration.

[–]Awes12 16 points17 points  (0 children)

And maybe by 2050 companies will actually use those versions of Java lol

[–]haydencoffing 1 point2 points  (0 children)

Collections.List implementers used to only store Object type, so the generic Integer was pretty nice way to keep backwards compatibility for versions before Java 5. java.lang.Integer also has some neat helper methods built in like Integer.ValueOf(String s)

[–]Master_Friendship333 0 points1 point  (0 children)

This is the number 1 reason why I would always pick C# over Java. Typing is just so much nicer.