Java Object to String castString(Object obj)

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

Description

cast String

Declaration

public static String castString(Object obj) 

Method Source Code

//package com.java2s;

public class Main {
    public static String castString(Object obj) {
        return castString(obj, "");
    }//from  w  ww.  ja v a  2  s  . c o  m

    public static String castString(Object obj, String defaultValue) {
        return obj != null ? String.valueOf(obj) : defaultValue;
    }
}

Related

  1. castString(Object o)
  2. castString(Object obj, String defaultValue)
  3. castString(Object val)
  4. castToString(Object inValue)
  5. castToString(Object object)