Here you can find the source of objectToString(Object obj)
public static String objectToString(Object obj)
//package com.java2s; //License from project: Apache License public class Main { public static String objectToString(Object obj) { return objectToString(obj, null); }/* w w w .j a v a 2 s . c om*/ public static String objectToString(Object obj, String added) { String result = added; if (obj != null) { result = String.valueOf(obj); } return result; } }