Here you can find the source of toString(Object object)
Parameter | Description |
---|---|
object | a parameter |
protected static String toString(Object object)
//package com.java2s; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); /**/*from w ww. j a va 2 s. c o m*/ * * @param object * @return */ protected static String toString(Object object) { if (object == null) { return ""; } else if (object instanceof Date) { return df.format(object); } else if (object instanceof Timestamp) { return df.format(object); } else return object.toString(); } }