Here you can find the source of valueOf(Object object)
This method calls String#valueOf(Object) unless the object is null, in which case null is returned
Parameter | Description |
---|---|
object | The object |
public static String valueOf(Object object)
//package com.java2s; // are made available under the terms of the Eclipse Public License v1.0 public class Main { /** The String value of an Object * <p>This method calls {@link String#valueOf(Object)} unless the object is null, * in which case null is returned</p> * @param object The object/* w w w. j a v a 2s . c om*/ * @return String value or null */ public static String valueOf(Object object) { return object == null ? null : String.valueOf(object); } }