Java Array to String array2String(long[] array)

Here you can find the source of array2String(long[] array)

Description

array String

License

LGPL

Declaration

public static String array2String(long[] array) 

Method Source Code

//package com.java2s;

public class Main {
    public static String array2String(long[] array) {
        StringBuffer ret = new StringBuffer("[");

        if (array != null) {
            for (int i = 0; i < array.length; i++)
                ret.append(array[i]).append(" ");
        }/*from w ww  .jav a2 s  .  c  o m*/

        ret.append(']');
        return ret.toString();
    }

    public static String array2String(int[] array) {
        StringBuffer ret = new StringBuffer("[");

        if (array != null) {
            for (int i = 0; i < array.length; i++)
                ret.append(array[i]).append(" ");
        }

        ret.append(']');
        return ret.toString();
    }

    public static String array2String(boolean[] array) {
        StringBuffer ret = new StringBuffer("[");

        if (array != null) {
            for (int i = 0; i < array.length; i++)
                ret.append(array[i]).append(" ");
        }
        ret.append(']');
        return ret.toString();
    }
}

Related

  1. array2String(double[] array)
  2. array2String(E[] array)
  3. array2string(final T[] array, final int top)
  4. array2string(int[] _a)
  5. array2String(int[] paramArrayOfInt)
  6. array2String(long[] array)
  7. array2String(Object[] a, int size)
  8. array2string(Object[] array)
  9. array2String(Object[] objs)