Here you can find the source of toString(Object obj)
public static String toString(Object obj)
//package com.java2s; public class Main { public static String toString(Object obj) { if (obj == null) { return ""; }// w w w.jav a 2 s .c o m return obj.toString().trim(); } }