In Java, java.lang.Array
classes contain static methods for manipulating arrays. The following is Array
an analysis of all methods in the class:
-
public static Object get(Object array, int index)
: Get the element value at the specified array index. -
public static boolean getBoolean(Object array, int index)
: Gets the element value at the specified Boolean array index. -
public static byte getByte(Object array, int index)
: Get the element value at the specified byte array index. -
public static char getChar(Object array, int index)
: Get the element value at the specified character array index. -
public static short getShort(Object array, int index)
: Gets the element value at the specified short integer array index. -
public static int getInt(Object array, int index)
: Get the element value at the specified integer array index. -
public static long getLong(Object array, int index)
: Gets the element value at the specified long integer array index. -
public static float getFloat(Object array, int index)
: Get the element value at the specified single-precision floating-point array index. -
public static double getDouble(Object array, int index)
: Gets the element value at the specified double-precision floating-point array index. -
public static void set(Object array, int index, Object value)
: Sets the element value at the specified array index. -
public static void setBoolean(Object array, int index, boolean value)
: Sets the element value at the specified Boolean array index. -
public static void setByte(Object array, int index, byte value)
: Sets the element value at the specified byte array index. -
public static void setChar(Object array, int index, char value)
: Sets the element value at the specified character array index. -
public static void setShort(Object array, int index, short value)
: Sets the element value at the specified short integer array index. -
public static void setInt(Object array, int index, int value)
: Sets the element value at the specified integer array index. -
public static void setLong(Object array, int index, long value)
: Sets the element value at the specified long array index. -
public static void setFloat(Object array, int index, float value)
: Sets the element value at the specified single-precision floating-point array index. -
public static void setDouble(Object array, int index, double value)
: Sets the element value at the specified double-precision floating-point array index. -
public static int getLength(Object array)
: Get the length of the specified array. -
public static Object newInstance(Class<?> componentType, int length)
: Creates a new array of the specified type and length. -
public static Object newInstance(Class<?> componentType, int... dimensions)
: Creates a new array with the specified type and dimensions. -
public static void fill(Object[] a, Object val)
: Fills the entire array or elements within the specified range with the specified value. -
public static void fill(Object[] a, int fromIndex, int toIndex, Object val)
: Fill the elements in the specified range of the array with the specified value. -
public static void sort(Object[] a)
: Sort the array. -
public static void sort(Object[] a, int fromIndex, int toIndex)
: Sort the elements within the specified range of the array. -
public static String toString(Object[] a)
: Returns the contents of the array as a string.