Here you can find the source of printArray(Object[] array)
Parameter | Description |
---|---|
array | a parameter |
public static void printArray(Object[] array)
//package com.java2s; /**//w w w. ja v a 2 s.c o m * Generally useful methods for system-level operations. * * @author ronyeh, srk * * <p> * This software is distributed under the <a * href="http://hci.stanford.edu/research/copyright.txt">Berkeley Software * Distribution License</a>. * </p> * * @author <a href="http://graphics.stanford.edu/~ronyeh">Ron Yeh</a> ( * ronyeh(AT)cs.stanford.edu ) * @author <a href="http://hci.stanford.edu/srk">Scott Klemmer</a> ( * srk(AT)cs.stanford.edu ) */ public class Main { /** * Print an array to console. * * @param array */ public static void printArray(Object[] array) { String className = array[0].getClass().toString(); System.out.print(className.substring(className.lastIndexOf(".") + 1, className.length()) + " Array: ["); for (int i = 0; i < array.length; i++) { System.out.print(array[i]); if (i != array.length - 1) { System.out.print(", "); } } System.out.println("]"); } }