Java Array to String arrayToString(Object[] a)

Here you can find the source of arrayToString(Object[] a)

Description

array To String

License

Open Source License

Declaration

public static String arrayToString(Object[] a) 

Method Source Code

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

public class Main {
    public static String arrayToString(Object[] a) {
        if (a == null)
            return "null";
        int iMax = a.length - 1;
        if (iMax == -1)
            return "";
        StringBuilder b = new StringBuilder();
        for (int i = 0;; i++) {
            b.append(String.valueOf(a[i]));
            if (i == iMax)
                return b.toString();
            b.append(", ");
        }/*from  w  w  w .  j a v a  2 s. com*/
    }
}

Related

  1. arrayToString(Object array)
  2. arrayToString(Object obj)
  3. arrayToString(Object obj[])
  4. arrayToString(Object... keys)
  5. arrayToString(Object... objects)
  6. arrayToString(Object[] anArray, String aPrefix, String aSeparator, String aSuffix, String anEscapeChars, char anEscapeSymbol)
  7. arrayToString(Object[] args, String separator)
  8. arrayToString(Object[] arr)
  9. arrayToString(Object[] arr)