Java StringJoiner Usage print(int[] a)

Here you can find the source of print(int[] a)

Description

print

License

Apache License

Declaration

public static void print(int[] a) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.StringJoiner;

public class Main {
    public static void print(int[] a) {
        StringJoiner sj = new StringJoiner(",", "[", "]");
        for (int i = 0; i < a.length; i++) {
            sj.add(String.valueOf(a[i]));
        }/* ww  w  .j av  a 2s  .com*/
        System.out.println(sj.toString());
    }
}

Related

  1. join(final String left, final String right)
  2. join(String separator, Collection c)
  3. joinRepeating(String element, String delimiter, int times)
  4. joinToString(String sep, Iterable items)
  5. listToString(List list)
  6. split(String s)
  7. throwSafeguardError(String thisClassName, String thisMethodsName, String superClassName, String... namesOfMethodsWhoseDefaultImplementationUsesThisMethod)
  8. toCVS(Set buildRecordSetIds)