📜  java代码示例中的valueof

📅  最后修改于: 2022-03-11 14:52:42.215000             🧑  作者: Mango

代码示例1
/*
  The java string valueOf() method converts different types of 
  values into string. By the help of string valueOf() method, 
  you can convert int to string, long to string, boolean to string, 
  character to string, float to string, double to string, object to string 
  and char array to string.
*/
public static String valueOf(Object obj) {  
    return (obj == null) ? "null" : obj.toString();  
}  
// you can see more here: 
// https://www.javatpoint.com/java-string-valueof