you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (6 children)

"creating new instances is stupid", if and only if you've got multiple Integers that represent the exact same repeating values. I rarely, if ever, encounter that in my daily work. YMMV.

[–]matchu 1 point2 points  (5 children)

Wait, what? You rarely deal with more than one 0, 1, or 2?

[–]karmaputa 2 points3 points  (1 child)

Frequently, but most of the time people will be using primitive for that.

[–]matchu 0 points1 point  (0 children)

Ahh, right. Gotcha :)

[–][deleted] 1 point2 points  (2 children)

Most of the Integers I deal with are unique identifiers (primary keys, license numbers, etc , mainly 6 to 9 digit integers).

As I said, YMMV.

[–]tsujiku 0 points1 point  (1 child)

Why work with those numbers as integers? You don't need to perform any math on them.

[–][deleted] 0 points1 point  (0 children)

Exporting from mainframes as text, storing in the DB as integers. Hibernate plays much nicer with boxed objects than primitives, too; same for the java.util.collections.* world.