Here you can find the source of deepToString(Object[] array)
toString()
on each of the entries.
Parameter | Description |
---|---|
array | the array |
public static String deepToString(Object[] array)
//package com.java2s; /******************************************************************************* * Copyright (c) 2007, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * /*from w ww . jav a2 s .c om*/ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ public class Main { /** * Simple method to walk an array and call <code>toString()</code> on each of the entries. Does not descend into sub-collections. * @param array the array * @return the comma-separated string representation of the the array * @since 1.0.3 */ public static String deepToString(Object[] array) { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < array.length; i++) { buffer.append(array[i].toString()); if (i < array.length - 1) { buffer.append(','); } } return buffer.toString(); } }