Which one is faster? Integer.valueOf(String string) or Integer.parseInt(String string)?

后端 未结 4 1008
执笔经年
执笔经年 2021-02-06 01:41

I want to know which method is faster?

Integer.valueOf(String string) or Integer.parseInt(String string)?

Is there any Performance or M

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-06 02:21

    valueOf(String) returns a new Integer() object whereas parseInt(String) returns a primitive int.

提交回复
热议问题