Java Collection Print printCollection(Collection col)

Here you can find the source of printCollection(Collection col)

Description

Print contents of collection.

License

Open Source License

Parameter

Parameter Description
col a parameter

Declaration

public static void printCollection(Collection col) 

Method Source Code

//package com.java2s;
/*/*w  w  w.  j  av a2s .  c o m*/
 * @(#)Util.java        1.00 2005/03/16
 * @author  Denny
 * Copyright (c) 1994-2005 Teansun, Inc.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of Teamsun, Inc.
 * 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 Teamsun.
 *
 */

import java.util.*;

public class Main {
    /**
     * <p>Print contents of collection.</p>
     *
     * @param col
     */
    public static void printCollection(Collection col) {
        if (col != null) {
            Iterator itr = col.iterator();

            while (itr.hasNext()) {
                System.out.println(itr.next().toString());
            }
        }
    }
}

Related

  1. print(Collection c)
  2. print(Collection coll)
  3. print(Collection elements)
  4. print(java.util.Collection collection)
  5. printCollection(Collection c)
  6. printCollection(Collection collection)
  7. printCollection(Collection l)
  8. printCollection(Collection col)
  9. printCollection(Collection collections)