Java Object Value Of valueOf(Object o)

Here you can find the source of valueOf(Object o)

Description

This works the same as String#valueOf(Object) , except it returns an empty string instead of "null" if the input is null.

License

Open Source License

Declaration

public static String valueOf(Object o) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /** This works the same as {@link String#valueOf(Object)}, except it returns an empty string instead of "null" if the input is null. */
    public static String valueOf(Object o) {
        return o == null ? "" : String.valueOf(o);
    }/*from   www.  j  a  v a  2s .c o  m*/
}

Related

  1. valueOf(final Object o)
  2. valueOf(Object o)
  3. valueOf(Object o)
  4. valueOf(Object obj)
  5. valueOf(Object obj)