Java Array Methods

The Array Class provides various Java Array Methods, or Functions for manipulating arrays. The Java Array Method performs Searching array items, sorting them etc. This Array Class also contains a static factory which allows arrays to be viewed as Lists.

Let us see the available list of Java Array Methods and its corresponding description. You can use the hyperlinks to get the detailed information of each Java Array Method, along with the practical example.

Java Array Methods

The following table will show you the list of available Array Functions in Java Array Class

Modifier and TypeJava Array MethodsDescription
static intbinarySearch(byte[] x, byte key)It search the byte array x for user specified byte value(key) using binary search algorithm.
static intbinarySearch(byte[] x, int fromIndex, int toIndex, byte key)This Java Array method search the range of a byte array x for user specified byte value(key) using binary search algorithm.
static intbinarySearch(char[] x, char key)It search the character array x for user specified character(key) using binary search algorithm.
static intbinarySearch(char[] x, int fromIndex, int toIndex, char key)It search the range of a character array x for user specified character(key) using binary search algorithm.
static intbinarySearch(short[] x, short key)This Java Array method search the short array x for user specified short value(key) using binary search algorithm.
static intbinarySearch(short[] x, int fromIndex, int toIndex, short key)It search the range of an short Array x for user specified short value(key) using binary search algorithm.
static intbinarySearch(double[] x, double key)It search the double array x for user specified double value(key) using binary search algorithm.
static intbinarySearch(double[] x, int fromIndex, int toIndex, double key)This Java Array method assign the user specified Doubl value (val) to each and every element present in-between the specified range of the array x
static intbinarySearch(float[] x, float key)It search the Float array x for user specified floating point value(key) using binary search algorithm.
static intbinarySearch(float[] x, int fromIndex, int toIndex, float key)It assign the user specified Floating point value (val) to each and every element present in-between the specified range of the array x
static intbinarySearch(int[] x, int key)This Java Array method search the Integer array x for user specified Integer(key) using binary search algorithm.
static intbinarySearch(int[] x, int fromIndex, int toIndex, int key)It assign the user specified Integer value (val) to each and every element present in-between a specified range of the array x
static intbinarySearch(long[] x, long key)This Java Array Method search the Long array x for user specified long value(key) using binary search algorithm.
static intbinarySearch(long[] x, int fromIndex, int toIndex, long key)It assign the user specified Long value (val) to each and every element present between the specified range of the array x
static intbinarySearch(Object[] x, Object key)It search the Object array x for user specified Object(key) using binary search algorithm.
static intbinarySearch(Object[] x, int fromIndex, int toIndex, Object key)This Java Array function assign the user specified Object(val) to each and every element present in-between the specified range of the array x
static boolean[]copyOf(boolean[] x, int newLength)It copy the Boolean Array x into New Boolean array of user specified length.
static byte[]copyOf(byte[] x, int newLength)It copy the byte Array x into New byte array of user specified length.
static char[]copyOf(char[] x, int newLength)It copy the char Array x into New char array of user specified length.
static short[]copyOf(short[] x, int newLength)It copy the short Array x into New short array of user specified length.
static double[]copyOf(double[] x, int newLength)Copyof Java Array Method copy the double Array x into New double array of user specified length.
static float[]copyOf(float[] x, int newLength)It copy the float Array x into New float array of user specified length.
static int[]copyOf(int[] x, int newLength)It copy the integer Array x into New integer array of user specified length.
static long[]copyOf(long[] x, int newLength)It copy the Long Array x into New Long array of user specified length.
static <T> T[]copyOf(T[] x, int newLength)It copy the Object Array x into New Object array of user specified length.
static <T, U> T[]copyOf(U[] x, int newLength, Class<? extends T[]> newType)This Java Array Method copy the specified range of Object Array x into New array of user specified length and type.
static boolean[]copyOfRange(boolean[] x, int from, int to)It copy the specified range of Boolean Array x into a New array.
static byte[]copyOfRange(byte[] x, int from, int to)It copy the specified range of Byte Array x into a New array.
static char[]copyOfRange(char[] x, int from, int to)It copy the specified range of Char Array x into a New array.
static short[]copyOfRange(short[] x,int from, int to)It copy the specified range of Short Array x into a New array.
static double[]copyOfRange(double[] x, int from, int to)It copy the specified range of Double Array x into a New array.
static float[]copyOfRange(float[] x, int from, int to)It copy the float Array x into New float array of user specified length.
static int[]copyOfRange(int[] x, int from, int to)It copy the specified range of integer Array x into a New array.
static long[]copyOfRange(long[] x,int from, int to)It copy the specified range of Long Array x into a New array.
static <T> T[]copyOfRange(T[] x,int from, int to)It copy the specified range of Object Array x into a New array.
static <T, U> T[]copyOfRange(U[] x, int from, int to, Class<? copyOfRange T[]> newType)It copy the specified range of Object Array x into a New array of specified type.
static booleanequals(boolean[] x, boolean[] y)It return boolean TRUE, If Boolean arrays x and y are equal to one another.
static booleanequals(byte[] x, byte[] y)This Java Array Method return boolean TRUE, If Byte arrays x and y are equal to one another.
static booleanequals(char[] x, char[] y)It return boolean TRUE, If Charatcers arrays x and y are equal to one another.
static booleanequals(short[] x, short[] y)It return boolean TRUE, If Short arrays x and y are equal to one another.
static booleanequals(double[] x, double[] y)This Java Array Method returns boolean TRUE, If Double arrays x and y are equal to one another.
static booleanequals(float[] x, float[] y)It return boolean TRUE, If Float arrays x and y are equal to one another.
static booleanequals(int[] x, int[] y)If x and y arrays of Integers are equal to one another, it returns boolean TRUE
static booleanequals(long[] x, long[] y)This Java Array Method return boolean TRUE, If Long arrays x and y are equal to one another.
static booleanequals(Object[] x, Object[] y)It return boolean TRUE, If Object arrays x and y are equal to one another.
static voidfill(boolean[] x, boolean val)It assign the user specified boolean value (val) to each and every element of the array x
static voidfill(boolean[] x, int fromIndex, int toIndex, boolean val)It assign the user specified boolean value (val) to each and every element present in-between the specified range of the array x
static voidfill(byte[] x, byte val)It assign the user specified byte(val) to each and every element of the array x
static voidfill(byte[] x, int fromIndex, int toIndex, byte val)It assign the user specified byte value(val) to each and every element present in-between the specified range of the array x
static voidfill(char[] x, char val)This Java Array Method assign the user specified Character (val) to each and every element of the array x
static voidfill(char[] x, int fromIndex, int toIndex, char val)It assign the user specified Character (val) to each and every element present in-between the specified range of the array x
static voidfill(short[] x, short val)It assign the user specified short value (val) to every element of the array x
static voidfill(short[] x, int fromIndex, int toIndex, short val)It assign the user specified short value (val) to each element present in-between the specified range of the array x
static voidfill(double[] x, double val)It assign the user specified Double value (val) to each element of the array x
static voidfill(double[] x, int fromIndex, int toIndex, double val)It assign the user specified Doubl value (val) to every element present in-between the specified range of the array x
static voidfill(float[] x, float val)It assign the user specified Floating point value (val) to every element of the array x
static voidfill(float[] x, int fromIndex, int toIndex, float val)This Java Array Method assign the user specified Floating point value (val) to each and every element present in-between the specified range of the array x
static voidfill(int[] x, int val)It assign the user specified Integer value (val) to each element of the array x
static voidfill(int[] x, int fromIndex, int toIndex, int val)It assign the user specified Integer value (val) to every element present in-between the specified range of the array x
static voidfill(long[] x, long val)It assign the user specified Long value (val) to each element of the array x
static voidfill(long[] x, int fromIndex, int toIndex, long val)This Java Array Method assign the user specified Long value (val) to each and every element present in-between the specified range of the array x
static voidfill(Object[] x, Object val)It assign the user specified Object(val) to eevery element of the array x
static voidfill(Object[] x, int fromIndex, int toIndex, Object val)It assign the user specified Object(val) to each and every element present in-between the specified range of the array x
static inthashCode(boolean[] a)This Java Array Method returns the Hashcode based on the contents of the Boolean array
static inthashCode(byte[] myArray)Returns the Hashcode based on the contents of the Byte array
static inthashCode(char[] myArray)Returns the Hashcode based on the contents of the character array
static inthashCode(short[] a)This Java Array Method returns the Hashcode based on the contents of the specified array
static inthashCode(double[] myArray)Returns the Hashcode based on the contents of the Double array
static inthashCode(float[] myArray)Returns the Hashcode based on the contents of the Float array
static inthashCode(int[] myArray)Returns the Hashcode based on the contents of the Integer array
static inthashCode(long[] myArray)This Java Array Method returns the Hashcode based on the contents of the Long array
static inthashCode(Object[] myArray)Returns the Hashcode based on the contents of the Object array
static voidsort(byte[] x)It Sort the user specified Byte array into Ascending Numerical Order
static voidsort(byte[] x, int fromIndex, int toIndex)This Java Array Method assign the user specified byte value(val) to each and every element present in-between the specified range of the array x
static voidsort(char[] x)It Sort the user specified Character array into Ascending Numerical Order
static voidsort(char[] x, int fromIndex, int toIndex)It assign the user specified Character (val) to each and every element present in-between the specified range of the array x
static voidsort(short[] x)This Java Array Method Sort the user specified short array into Ascending Numerical Order
static voidsort(short[] x, int fromIndex, int toIndex)It assigns the user given short value (val) to each and every element present in-between the specified range of the array x
static voidsort(double[] x)It Sort the user specified Double array into Ascending Numerical Order
static voidsort(double[] x, int fromIndex, int toIndex)It assigns the user specified Double value (val) to every element present in-between the specified range of the array x
static voidsort(float[] x, float val)This Java Array Method assign the Floating point value (val) to each element of the array x
static voidsort(float[] x, int fromIndex, int toIndex, float val)It assigns the specified Floating point value (val) to every element present in-between the specified range of the array x
static voidsort(int[] x, int val)It assigns the user specified Integer value (val) to each element of the array x
static voidsort(int[] x, int fromIndex, int toIndex, int val)This Java Array Method assign the user specified Integer value (val) to each and every element present in-between the specified range of the array x
static voidsort(long[] x, long val)It assigns the user-specified Long value (val) to every element of the array x
static voidsort(long[] x, int fromIndex, int toIndex, long val)It assigns the user specified Long value (val) to each element present in-between the specified range of the array x
static voidsort(Object[] x, Object val)It assign the user specified Object(val) to each and every element of the array x
static voidsort(Object[] x, int fromIndex, int toIndex, Object val)This Java Array Method assign the user specified Object(val) to each and every element present in-between the specified range of the array x
static StringtoString(boolean[] a)Returns a string representation of the contents of the Boolean array
static StringtoString(byte[] myByteArray)Returns a string representation of the contents of the Byte array
static StringtoString(char[] myArray)Returns a string representation of the contents of the character array
static StringtoString(short[] a)Returns a string representationof the contents of the specified array
static StringtoString(double[] myArray)This Java Array method returns a string representation of the contents of the Double array
static StringtoString(float[] myArray)Returns a string representation of the contents of the Float array
static StringtoString(int[] myArray)Returns a string representation of the contents of the Integer array
static StringtoString(long[] myArray)Returns a string representation of the contents of the Long array
static StringtoString(Object[] myArray)This Java Array method returns a string representation of the contents of the Object array