In Java, is there any difference between String.valueOf(Object) and Object.toString()? Is there a specific code convention for these?
String.valueOf(Object)
Object.toString()
When argument is null, the String.valueOf returns "null", but Object.toString throws NullPointerException, that's the only difference.
null
String.valueOf
"null"
Object.toString
NullPointerException