I want to know which method is faster?
Integer.valueOf(String string)
or Integer.parseInt(String string)
?
Is there any Performance or M
I would not look at performance. The API says that Integer.valueOf(String)
is interpreted the same as if it has been passed to Integer.parseInt(String)
, except it is wrapped into an Integer
. I would look at what you need: an Integer
or an int
.
Integer.valueOf
returns an Integer
.
Integer.parseInt
returns an int
.