Java Array to String arrayToString(T[] ar)

Here you can find the source of arrayToString(T[] ar)

Description

array To String

License

Apache License

Declaration

public static <T> String arrayToString(T[] ar) 

Method Source Code

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

public class Main {
    public static <T> String arrayToString(T[] ar) {
        StringBuilder sb = new StringBuilder("[");
        boolean first = true;
        for (Object o : ar) {
            if (!first) {
                sb.append(", ");
            }/*  w  w w. java  2s .co  m*/
            sb.append(o);
            first = false;
        }
        sb.append("]");
        return sb.toString();
    }
}

Related

  1. arrayToString(String[] values)
  2. arrayToString(String[] values)
  3. ArrayToString(String[] values)
  4. arrayToString(String[] values)
  5. arrayToString(String[] values)
  6. arrayToString(T[] array)
  7. arrayToString(T[] array)
  8. arrayToString(T[] array)
  9. arrayToString(T[] array)