Java Object Value Of valueOf(Object obj)

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

Description

transform a Obejct 2 a String ,return value is "" when object is null

License

Open Source License

Parameter

Parameter Description
obj a parameter

Declaration

public static String valueOf(Object obj) 

Method Source Code

//package com.java2s;

public class Main {
    /**//  w  w  w  .j a  v a 2s  .  c  o m
     * transform a Obejct 2 a String ,return value is "" when object is null
     * @param obj
     * @return
     * @author qiumm
     */
    public static String valueOf(Object obj) {
        return (obj == null) ? "" : obj.toString();
    }
}

Related

  1. valueOf(final Object o)
  2. valueOf(Object o)
  3. valueOf(Object o)
  4. valueOf(Object o)
  5. valueOf(Object obj)
  6. valueOf(Object obj)
  7. valueOf(Object object)
  8. valueOf(Object value)
  9. valueOf(Object[] array)