java.util
Class Arrays

java.lang.Object
  extended by java.util.Arrays

public class Arrays
extends Object

Various tools for arrays. NOTE: currently bubblesort is used for sorting arrays.

Author:
Juan Antonio Brenha Moral, Sven Köhler

Method Summary
static int binarySearch(byte[] a, byte val)
          Binary search for element in sorted array.
static int binarySearch(byte[] a, int fromIndex, int toIndex, byte key)
          Binary search for element in sorted array.
static int binarySearch(char[] a, char val)
          Binary search for element in sorted array.
static int binarySearch(char[] a, int fromIndex, int toIndex, char key)
          Binary search for element in sorted array.
static int binarySearch(double[] a, double val)
          Binary search for element in sorted array.
static int binarySearch(double[] a, int fromIndex, int toIndex, double key)
          Binary search for element in sorted array.
static int binarySearch(float[] a, float val)
          Binary search for element in sorted array.
static int binarySearch(float[] a, int fromIndex, int toIndex, float key)
          Binary search for element in sorted array.
static int binarySearch(int[] a, int val)
          Binary search for element in sorted array.
static int binarySearch(int[] a, int fromIndex, int toIndex, int key)
          Binary search for element in sorted array.
static int binarySearch(long[] a, int fromIndex, int toIndex, long key)
          Binary search for element in sorted array.
static int binarySearch(long[] a, long val)
          Binary search for element in sorted array.
static int binarySearch(Object[] a, int fromIndex, int toIndex, Object key)
          Binary search for element in sorted array.
static int binarySearch(Object[] a, Object val)
          Binary search for element in sorted array.
static int binarySearch(short[] a, int fromIndex, int toIndex, short key)
          Binary search for element in sorted array.
static int binarySearch(short[] a, short val)
          Binary search for element in sorted array.
static boolean[] copyOf(boolean[] a, int newLength)
          Creates a copy with a given length of an array.
static byte[] copyOf(byte[] a, int newLength)
          Creates a copy with a given length of an array.
static char[] copyOf(char[] a, int newLength)
          Creates a copy with a given length of an array.
static double[] copyOf(double[] a, int newLength)
          Creates a copy with a given length of an array.
static float[] copyOf(float[] a, int newLength)
          Creates a copy with a given length of an array.
static int[] copyOf(int[] a, int newLength)
          Creates a copy with a given length of an array.
static long[] copyOf(long[] a, int newLength)
          Creates a copy with a given length of an array.
static short[] copyOf(short[] a, int newLength)
          Creates a copy with a given length of an array.
static boolean[] copyOfRange(boolean[] a, int fromIndex, int toIndex)
          Creates a copy with a given length of an array.
static byte[] copyOfRange(byte[] a, int fromIndex, int toIndex)
          Creates a copy with a given length of an array.
static char[] copyOfRange(char[] a, int fromIndex, int toIndex)
          Creates a copy with a given length of an array.
static double[] copyOfRange(double[] a, int fromIndex, int toIndex)
          Creates a copy with a given length of an array.
static float[] copyOfRange(float[] a, int fromIndex, int toIndex)
          Creates a copy with a given length of an array.
static int[] copyOfRange(int[] a, int fromIndex, int toIndex)
          Creates a copy with a given length of an array.
static long[] copyOfRange(long[] a, int fromIndex, int toIndex)
          Creates a copy with a given length of an array.
static short[] copyOfRange(short[] a, int fromIndex, int toIndex)
          Creates a copy with a given length of an array.
static boolean equals(boolean[] a, boolean[] b)
          EQUALS
static boolean equals(byte[] a, byte[] b)
           
static boolean equals(char[] a, char[] b)
           
static boolean equals(double[] a, double[] b)
           
static boolean equals(float[] a, float[] b)
           
static boolean equals(int[] a, int[] b)
           
static boolean equals(long[] a, long[] b)
           
static boolean equals(Object[] a, Object[] b)
           
static boolean equals(short[] a, short[] b)
           
static void fill(boolean[] a, boolean val)
          Set array elements to given value.
static void fill(boolean[] a, int fromIndex, int toIndex, boolean val)
          Set array elements to given value.
static void fill(byte[] a, byte val)
          Set array elements to given value.
static void fill(byte[] a, int fromIndex, int toIndex, byte val)
          Set array elements to given value.
static void fill(char[] a, char val)
          Set array elements to given value.
static void fill(char[] a, int fromIndex, int toIndex, char val)
          Set array elements to given value.
static void fill(double[] a, double val)
          Set array elements to given value.
static void fill(double[] a, int fromIndex, int toIndex, double val)
          Set array elements to given value.
static void fill(float[] a, float val)
          Set array elements to given value.
static void fill(float[] a, int fromIndex, int toIndex, float val)
          Set array elements to given value.
static void fill(int[] a, int val)
          Set array elements to given value.
static void fill(int[] a, int fromIndex, int toIndex, int val)
          Set array elements to given value.
static void fill(long[] a, int fromIndex, int toIndex, long val)
          Set array elements to given value.
static void fill(long[] a, long val)
          Set array elements to given value.
static void fill(Object[] a, int fromIndex, int toIndex, Object val)
          Set array elements to given value.
static void fill(Object[] a, Object val)
          Set array elements to given value.
static void fill(short[] a, int fromIndex, int toIndex, short val)
          Set array elements to given value.
static void fill(short[] a, short val)
          Set array elements to given value.
static void sort(byte[] a)
          Sort the specified array in ascending order.
static void sort(byte[] a, int fromIndex, int toIndex)
          Sort the specified array in ascending order.
static void sort(char[] a)
          Sort the specified array in ascending order.
static void sort(char[] a, int fromIndex, int toIndex)
          Sort the specified array in ascending order.
static void sort(double[] a)
          Sort the specified array in ascending order.
static void sort(double[] a, int fromIndex, int toIndex)
          Sort the specified array in ascending order.
static void sort(float[] a)
          Sort the specified array in ascending order.
static void sort(float[] a, int fromIndex, int toIndex)
          Sort the specified array in ascending order.
static void sort(int[] a)
          Sort the specified array in ascending order.
static void sort(int[] a, int fromIndex, int toIndex)
          Sort the specified array in ascending order.
static void sort(long[] a)
          Sort the specified array in ascending order.
static void sort(long[] a, int fromIndex, int toIndex)
          Sort the specified array in ascending order.
static void sort(Object[] a)
          Sort the specified array in ascending order.
static void sort(Object[] a, int fromIndex, int toIndex)
          Sort the specified array in ascending order.
static void sort(short[] a)
          Sort the specified array in ascending order.
static void sort(short[] a, int fromIndex, int toIndex)
          Sort the specified array in ascending order.
static String toString(boolean[] a)
          Returns a String representation of the array.
static String toString(byte[] a)
          Returns a String representation of the array.
static String toString(char[] a)
          Returns a String representation of the array.
static String toString(double[] a)
          Returns a String representation of the array.
static String toString(float[] a)
          Returns a String representation of the array.
static String toString(int[] a)
          Returns a String representation of the array.
static String toString(long[] a)
          Returns a String representation of the array.
static String toString(Object[] a)
          Returns a String representation of the array.
static String toString(short[] a)
          Returns a String representation of the array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

binarySearch

public static int binarySearch(byte[] a,
                               byte val)
Binary search for element in sorted array.

Parameters:
a - the sorted array
val - the value
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(byte[] a,
                               int fromIndex,
                               int toIndex,
                               byte key)
Binary search for element in sorted array.

Parameters:
a - the sorted array
fromIndex - index of first element (inclusive) to consider
toIndex - index of last element (exclusive) to consider
key - the value to search for
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(short[] a,
                               short val)
Binary search for element in sorted array.

Parameters:
a - the sorted array
val - the value
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(short[] a,
                               int fromIndex,
                               int toIndex,
                               short key)
Binary search for element in sorted array.

Parameters:
a - the sorted array
fromIndex - index of first element (inclusive) to consider
toIndex - index of last element (exclusive) to consider
key - the value to search for
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(char[] a,
                               char val)
Binary search for element in sorted array.

Parameters:
a - the sorted array
val - the value
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(char[] a,
                               int fromIndex,
                               int toIndex,
                               char key)
Binary search for element in sorted array.

Parameters:
a - the sorted array
fromIndex - index of first element (inclusive) to consider
toIndex - index of last element (exclusive) to consider
key - the value to search for
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(int[] a,
                               int val)
Binary search for element in sorted array.

Parameters:
a - the sorted array
val - the value
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(int[] a,
                               int fromIndex,
                               int toIndex,
                               int key)
Binary search for element in sorted array.

Parameters:
a - the sorted array
fromIndex - index of first element (inclusive) to consider
toIndex - index of last element (exclusive) to consider
key - the value to search for
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(long[] a,
                               long val)
Binary search for element in sorted array.

Parameters:
a - the sorted array
val - the value
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(long[] a,
                               int fromIndex,
                               int toIndex,
                               long key)
Binary search for element in sorted array.

Parameters:
a - the sorted array
fromIndex - index of first element (inclusive) to consider
toIndex - index of last element (exclusive) to consider
key - the value to search for
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(float[] a,
                               float val)
Binary search for element in sorted array.

Parameters:
a - the sorted array
val - the value
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(float[] a,
                               int fromIndex,
                               int toIndex,
                               float key)
Binary search for element in sorted array.

Parameters:
a - the sorted array
fromIndex - index of first element (inclusive) to consider
toIndex - index of last element (exclusive) to consider
key - the value to search for
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(double[] a,
                               double val)
Binary search for element in sorted array.

Parameters:
a - the sorted array
val - the value
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(double[] a,
                               int fromIndex,
                               int toIndex,
                               double key)
Binary search for element in sorted array.

Parameters:
a - the sorted array
fromIndex - index of first element (inclusive) to consider
toIndex - index of last element (exclusive) to consider
key - the value to search for
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(Object[] a,
                               Object val)
Binary search for element in sorted array.

Parameters:
a - the sorted array
val - the value
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

binarySearch

public static int binarySearch(Object[] a,
                               int fromIndex,
                               int toIndex,
                               Object key)
Binary search for element in sorted array.

Parameters:
a - the sorted array
fromIndex - index of first element (inclusive) to consider
toIndex - index of last element (exclusive) to consider
key - the value to search for
Returns:
the index at which the element was found, or otherwise (-index -1) where index denotes the index at which the element should be inserted

copyOf

public static boolean[] copyOf(boolean[] a,
                               int newLength)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary.

Parameters:
a - the array to copy
newLength - length of the copy
Returns:
the copy of the array

copyOf

public static byte[] copyOf(byte[] a,
                            int newLength)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary.

Parameters:
a - the array to copy
newLength - length of the copy
Returns:
the copy of the array

copyOf

public static short[] copyOf(short[] a,
                             int newLength)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary.

Parameters:
a - the array to copy
newLength - length of the copy
Returns:
the copy of the array

copyOf

public static char[] copyOf(char[] a,
                            int newLength)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary.

Parameters:
a - the array to copy
newLength - length of the copy
Returns:
the copy of the array

copyOf

public static int[] copyOf(int[] a,
                           int newLength)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary.

Parameters:
a - the array to copy
newLength - length of the copy
Returns:
the copy of the array

copyOf

public static long[] copyOf(long[] a,
                            int newLength)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary.

Parameters:
a - the array to copy
newLength - length of the copy
Returns:
the copy of the array

copyOf

public static float[] copyOf(float[] a,
                             int newLength)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary.

Parameters:
a - the array to copy
newLength - length of the copy
Returns:
the copy of the array

copyOf

public static double[] copyOf(double[] a,
                              int newLength)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary.

Parameters:
a - the array to copy
newLength - length of the copy
Returns:
the copy of the array

copyOfRange

public static boolean[] copyOfRange(boolean[] a,
                                    int fromIndex,
                                    int toIndex)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary. Note that toIndex may be larger then a.length.

Parameters:
a - the array to copy
fromIndex - index of first element (inclusive) to copy
toIndex - index of last element (exclusive) to copy
Returns:
the copy of the array

copyOfRange

public static byte[] copyOfRange(byte[] a,
                                 int fromIndex,
                                 int toIndex)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary. Note that toIndex may be larger then a.length.

Parameters:
a - the array to copy
fromIndex - index of first element (inclusive) to copy
toIndex - index of last element (exclusive) to copy
Returns:
the copy of the array

copyOfRange

public static short[] copyOfRange(short[] a,
                                  int fromIndex,
                                  int toIndex)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary. Note that toIndex may be larger then a.length.

Parameters:
a - the array to copy
fromIndex - index of first element (inclusive) to copy
toIndex - index of last element (exclusive) to copy
Returns:
the copy of the array

copyOfRange

public static char[] copyOfRange(char[] a,
                                 int fromIndex,
                                 int toIndex)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary. Note that toIndex may be larger then a.length.

Parameters:
a - the array to copy
fromIndex - index of first element (inclusive) to copy
toIndex - index of last element (exclusive) to copy
Returns:
the copy of the array

copyOfRange

public static int[] copyOfRange(int[] a,
                                int fromIndex,
                                int toIndex)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary. Note that toIndex may be larger then a.length.

Parameters:
a - the array to copy
fromIndex - index of first element (inclusive) to copy
toIndex - index of last element (exclusive) to copy
Returns:
the copy of the array

copyOfRange

public static long[] copyOfRange(long[] a,
                                 int fromIndex,
                                 int toIndex)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary. Note that toIndex may be larger then a.length.

Parameters:
a - the array to copy
fromIndex - index of first element (inclusive) to copy
toIndex - index of last element (exclusive) to copy
Returns:
the copy of the array

copyOfRange

public static float[] copyOfRange(float[] a,
                                  int fromIndex,
                                  int toIndex)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary. Note that toIndex may be larger then a.length.

Parameters:
a - the array to copy
fromIndex - index of first element (inclusive) to copy
toIndex - index of last element (exclusive) to copy
Returns:
the copy of the array

copyOfRange

public static double[] copyOfRange(double[] a,
                                   int fromIndex,
                                   int toIndex)
Creates a copy with a given length of an array. The data is truncated/padded to the given length as necessary. Note that toIndex may be larger then a.length.

Parameters:
a - the array to copy
fromIndex - index of first element (inclusive) to copy
toIndex - index of last element (exclusive) to copy
Returns:
the copy of the array

equals

public static boolean equals(boolean[] a,
                             boolean[] b)
EQUALS


equals

public static boolean equals(byte[] a,
                             byte[] b)

equals

public static boolean equals(short[] a,
                             short[] b)

equals

public static boolean equals(char[] a,
                             char[] b)

equals

public static boolean equals(int[] a,
                             int[] b)

equals

public static boolean equals(long[] a,
                             long[] b)

equals

public static boolean equals(float[] a,
                             float[] b)

equals

public static boolean equals(double[] a,
                             double[] b)

equals

public static boolean equals(Object[] a,
                             Object[] b)

fill

public static void fill(boolean[] a,
                        boolean val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(boolean[] a,
                        int fromIndex,
                        int toIndex,
                        boolean val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

fill

public static void fill(byte[] a,
                        byte val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(byte[] a,
                        int fromIndex,
                        int toIndex,
                        byte val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

fill

public static void fill(short[] a,
                        short val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(short[] a,
                        int fromIndex,
                        int toIndex,
                        short val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

fill

public static void fill(char[] a,
                        char val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(char[] a,
                        int fromIndex,
                        int toIndex,
                        char val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

fill

public static void fill(int[] a,
                        int val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(int[] a,
                        int fromIndex,
                        int toIndex,
                        int val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

fill

public static void fill(long[] a,
                        long val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(long[] a,
                        int fromIndex,
                        int toIndex,
                        long val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

fill

public static void fill(float[] a,
                        float val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(float[] a,
                        int fromIndex,
                        int toIndex,
                        float val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

fill

public static void fill(double[] a,
                        double val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(double[] a,
                        int fromIndex,
                        int toIndex,
                        double val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

fill

public static void fill(Object[] a,
                        Object val)
Set array elements to given value.

Parameters:
a - the array
val - the value

fill

public static void fill(Object[] a,
                        int fromIndex,
                        int toIndex,
                        Object val)
Set array elements to given value.

Parameters:
a - the array
fromIndex - index of first element (inclusive) to set
toIndex - index of last element (exclusive) to set
val - the value

sort

public static void sort(byte[] a)
Sort the specified array in ascending order.

Parameters:
a - the array to sort

sort

public static void sort(byte[] a,
                        int fromIndex,
                        int toIndex)
Sort the specified array in ascending order.

Parameters:
a - the array to sort
fromIndex - index of first element (inclusive) to sort
toIndex - index of last element (exclusive) to sort

sort

public static void sort(short[] a)
Sort the specified array in ascending order.

Parameters:
a - the array to sort

sort

public static void sort(short[] a,
                        int fromIndex,
                        int toIndex)
Sort the specified array in ascending order.

Parameters:
a - the array to sort
fromIndex - index of first element (inclusive) to sort
toIndex - index of last element (exclusive) to sort

sort

public static void sort(char[] a)
Sort the specified array in ascending order.

Parameters:
a - the array to sort

sort

public static void sort(char[] a,
                        int fromIndex,
                        int toIndex)
Sort the specified array in ascending order.

Parameters:
a - the array to sort
fromIndex - index of first element (inclusive) to sort
toIndex - index of last element (exclusive) to sort

sort

public static void sort(int[] a)
Sort the specified array in ascending order.

Parameters:
a - the array to sort

sort

public static void sort(int[] a,
                        int fromIndex,
                        int toIndex)
Sort the specified array in ascending order.

Parameters:
a - the array to sort
fromIndex - index of first element (inclusive) to sort
toIndex - index of last element (exclusive) to sort

sort

public static void sort(long[] a)
Sort the specified array in ascending order.

Parameters:
a - the array to sort

sort

public static void sort(long[] a,
                        int fromIndex,
                        int toIndex)
Sort the specified array in ascending order.

Parameters:
a - the array to sort
fromIndex - index of first element (inclusive) to sort
toIndex - index of last element (exclusive) to sort

sort

public static void sort(float[] a)
Sort the specified array in ascending order.

Parameters:
a - the array to sort

sort

public static void sort(float[] a,
                        int fromIndex,
                        int toIndex)
Sort the specified array in ascending order.

Parameters:
a - the array to sort
fromIndex - index of first element (inclusive) to sort
toIndex - index of last element (exclusive) to sort

sort

public static void sort(double[] a)
Sort the specified array in ascending order.

Parameters:
a - the array to sort

sort

public static void sort(double[] a,
                        int fromIndex,
                        int toIndex)
Sort the specified array in ascending order.

Parameters:
a - the array to sort
fromIndex - index of first element (inclusive) to sort
toIndex - index of last element (exclusive) to sort

sort

public static void sort(Object[] a)
Sort the specified array in ascending order.

Parameters:
a - the array to sort

sort

public static void sort(Object[] a,
                        int fromIndex,
                        int toIndex)
Sort the specified array in ascending order.

Parameters:
a - the array to sort
fromIndex - index of first element (inclusive) to sort
toIndex - index of last element (exclusive) to sort

toString

public static String toString(boolean[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert

toString

public static String toString(byte[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert

toString

public static String toString(short[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert

toString

public static String toString(char[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert

toString

public static String toString(int[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert

toString

public static String toString(long[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert

toString

public static String toString(float[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert

toString

public static String toString(double[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert

toString

public static String toString(Object[] a)
Returns a String representation of the array.

Parameters:
a - the array to convert