Java Collection Tutorial - Java Arrays.toString(int[] a)


Arrays.toString(int[] a) has the following syntax.

public static String toString(int[] a)


In the following code shows how to use Arrays.toString(int[] a) method.

/*from  w  ww.  j  a va2 s .co  m*/
import java.util.Arrays;

public class Main {

   public static void main(String[] args) {

    int[] i1 = new int[] { 3, 12, 98 };


The code above generates the following result.