Java examples for java.lang:int Array
print Object Array
/*/*from w ww . j ava 2 s.com*/ * Copyright (c) 2002-2004 * All rights reserved. */ //package com.java2s; import java.util.Collection; import java.util.Iterator; public class Main { public static void main(String[] argv) throws Exception { Collection valueArrays = java.util.Arrays.asList("asdf", "java2s.com"); printObjectArray(valueArrays); } public static void printObjectArray(Collection valueArrays) { System.out.println("["); for (Iterator iterator = valueArrays.iterator(); iterator.hasNext();) { Object[] values = (Object[]) iterator.next(); System.out.print("["); for (int i = 0; i < values.length; i++) { Object value = values[i]; System.out.print(value); if ((i + 1) < values.length) System.out.print(","); } System.out.println("]"); } System.out.println("]"); } }