Here you can find the source of objectArrayToString(Object[] arr, String name)
public static String objectArrayToString(Object[] arr, String name)
//package com.java2s; /*-// w w w . j av a 2s.c o m * See the file LICENSE for redistribution information. * * Copyright (c) 2001, 2010 Oracle and/or its affiliates. All rights reserved. * * $Id$ */ public class Main { /** * Convert an object array to a string, suitable for use in * toString methods of the *Stat classes. * * @return Description of the Return Value */ public static String objectArrayToString(Object[] arr, String name) { if (arr == null) { return "null"; } StringBuffer sb = new StringBuffer(); int len = arr.length; for (int i = 0; i < len; i++) { sb.append("\n " + name + "[" + i + "]:\n"); sb.append(" " + arr[i].toString()); } return sb.toString(); } }