Created
April 3, 2018 10:28
-
-
Save dassiorleando/66c33ac072d4b4c30486b5fbe047b4c0 to your computer and use it in GitHub Desktop.
a part of valueOf method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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