Java Array Deep to String deepToString(int[] values)

Here you can find the source of deepToString(int[] values)

Description

Print the contents of an int[].

License

Open Source License

Declaration

public static String deepToString(int[] values) 

Method Source Code

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

public class Main {
    /**Print the contents of an int[].**/
    public static String deepToString(int[] values) {
        StringBuilder b = new StringBuilder();
        b.append("[");
        for (int i = 0; i < values.length; i++) {
            b.append(values[i]);//w  w  w .  j a v  a 2 s.co m
            b.append(", ");
        }
        b.delete(b.length() - 2, b.length() - 1);
        b.append("]");
        return b.toString();
    }
}

Related

  1. deepToString(double[][] array)
  2. deepToString(Object[] array)