You are viewing a single comment's thread. Return to all comments →
I wonder if there's any difference between static String.valueOf and static Integer.toString...
Ok, looking at the source code,
String.valueOf just calls Integer.toString, so the only difference is an extra method invocation.
Yeah! Good point. And it's only a convenience feature where we can pass any datatyped-value I guess..
It's better to use valueOf, because you will never get NPE.
Integer.toString(); Is always prefered here