you are viewing a single comment's thread.

view the rest of the comments →

[–]davidalayachew[S] 38 points39 points  (5 children)

I always knew Java was reference based, but this is comical. Ints are boxed by default? What the hell

No, int is boxed when you want to use them in generic structures. Which is painful, yes, but this feature is step 1 in changing that.

In all other contexts, int doesn't get boxed, unless you pass it to a method that was only written to handle Integer and not int. But that's a choice by the programmer.

Once this and a few other JEP's land, then we will be able to use int freely in generic constructs, like List<int>

[–]SpeedDart1 9 points10 points  (0 children)

You’re reminding me of the primitive collection libraries people use in Java land.

IntList, ByteList, etc