Here you can find the source of printArray(ArrayList
public static <T> void printArray(ArrayList<T> array)
//package com.java2s; /**/*from www . j a va 2s. co m*/ * Project: napoli.client * * File Created at Aug 12, 2009 * $Id: NapoliTestUtil.java 150227 2012-02-29 09:22:16Z yanny.wangyy $ * * Copyright 2008 Alibaba.com Croporation Limited. * All rights reserved. * * This software is the confidential and proprietary information of * Alibaba Company. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Alibaba.com. */ import java.util.ArrayList; import java.util.Iterator; public class Main { public static <T> void printArray(ArrayList<T> array) { Iterator it = array.iterator(); while (it.hasNext()) { System.out.println(it.next()); } } }