Skip to content

Instantly share code, notes, and snippets.

@dassiorleando
Created April 3, 2018 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dassiorleando/66c33ac072d4b4c30486b5fbe047b4c0 to your computer and use it in GitHub Desktop.
Save dassiorleando/66c33ac072d4b4c30486b5fbe047b4c0 to your computer and use it in GitHub Desktop.
a part of valueOf method
/**
* Returns the string representation of the {@code Object} argument.
*
* @param obj an {@code Object}.
* @return if the argument is {@code null}, then a string equal to
* {@code "null"}; otherwise, the value of
* {@code obj.toString()} is returned.
* @see java.lang.Object#toString()
*/
public static String valueOf(Object obj) {
return (obj == null) ? "null" : obj.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment