Aside from Integer.parseInt() handling the minus sign (as documented), are there any other differences between Integer.valueOf() and Integer.parseInt()?
And since neither can parse , as a decimal thousands separator (produces NumberFormatException), is there an already available Java method to do that?
Actually,
valueOfusesparseIntinternally. The difference isparseIntreturns anintprimitive whilevalueOfreturns anIntegerobject. Consider from the Integer.class source:As for parsing with a comma, I’m not familiar with one. I would sanitize them.