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


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

public static String toString(Object [] a)


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

/*w  w w.  ja va  2s. c  o m*/

import java.util.Arrays;

public class Main {

   public static void main(String[] args) {

    Object[] ob1 = new Object[] { 10, 20 };


The code above generates the following result.