I want to know which method is faster?
Integer.valueOf(String string) or Integer.parseInt(String string)?
Is there any Performance or Memory difference between the two approaches?
I have seen Difference between parseInt and valueOf in java? but this does not explains difference in terms of performance.
I would not look at performance. The API says that
Integer.valueOf(String)is interpreted the same as if it has been passed toInteger.parseInt(String), except it is wrapped into anInteger. I would look at what you need: anIntegeror anint.Integer.valueOfreturns anInteger.Integer.parseIntreturns anint.