Java Arrays.toString(Object [] a)

Syntax

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

public static String toString(Object [] a)

Example

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


//from w  w  w . ja  v  a2s  .co  m

import java.util.Arrays;

public class Main {

   public static void main(String[] args) {

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

    System.out.println(Arrays.toString(ob1));    
  }
}

The code above generates the following result.