Here you can find the source of print(Iterable list)
public static void print(Iterable list)
//package com.java2s; import java.util.*; public class Main { private static boolean verbose = true; public static void print(Iterable list) { for (Object obj : list) System.out.println(obj); }/*from ww w . j a v a 2s .c o m*/ /** * Print the list elements in raws. * The number of elements in a raw is determined by the parameter */ public static void print(ArrayList list, int rawLength, String format) { if (rawLength < 1) throw new RuntimeException("Raw Length cannot be shorter than one."); int i = 0; for (Object obj : list) { System.out.printf(format, obj); if (i % rawLength == 0) System.out.println(); i++; } System.out.println(); } public static void print(String s) { if (verbose) System.out.print(s); } public static void println(String s) { if (verbose) System.out.println(s); } public static void println() { if (verbose) System.out.println(); } }