Java List Print printNonEmptyList(List list)

Here you can find the source of printNonEmptyList(List list)

Description

print Non Empty List

License

Open Source License

Declaration

private static <T> void printNonEmptyList(List<T> list) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

public class Main {
    private static <T> void printNonEmptyList(List<T> list) {
        int len = list.size();
        System.out.print("[");
        for (int i = 0; i < len; i++) {
            if (i == len - 1) {
                System.out.println(list.get(i) + "]");
            } else {
                System.out.print(list.get(i) + ", ");
            }//from w ww .j  a va  2 s . c  o m
        }
    }
}

Related

  1. printListV(List l)
  2. printListWithDelimiter(Collection list, String delimiter)
  3. println(List text)
  4. printlnList(List list)
  5. printMap(HashMap> listHashMap)
  6. printObjectList(List list)
  7. printout(List record)
  8. printPerformanceStats(String message, List iterationTimesInNanoseconds)
  9. printQueryResults(List res)

  10. HOME | Copyright © www.java2s.com 2016