Class Array


  • public final class Array
    extends Object
    Provides static methods to create and access arrays dynamically.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Object get​(Object array, int index)
      Returns the element of the array at the specified index.
      static boolean getBoolean​(Object array, int index)
      Returns the boolean at the given index in the given boolean array.
      static byte getByte​(Object array, int index)
      Returns the byte at the given index in the given byte array.
      static char getChar​(Object array, int index)
      Returns the char at the given index in the given char array.
      static double getDouble​(Object array, int index)
      Returns the double at the given index in the given array.
      static float getFloat​(Object array, int index)
      Returns the float at the given index in the given array.
      static int getInt​(Object array, int index)
      Returns the int at the given index in the given array.
      static int getLength​(Object array)
      Returns the length of the array.
      static long getLong​(Object array, int index)
      Returns the long at the given index in the given array.
      static short getShort​(Object array, int index)
      Returns the short at the given index in the given array.
      static Object newInstance​(Class<?> componentType, int size)
      Returns a new array of the specified component type and length.
      static Object newInstance​(Class<?> componentType, int... dimensions)
      Returns a new multidimensional array of the specified component type and dimensions.
      static void set​(Object array, int index, Object value)
      Sets the element of the array at the specified index to the value.
      static void setBoolean​(Object array, int index, boolean value)
      Sets array[index] = value.
      static void setByte​(Object array, int index, byte value)
      Sets array[index] = value.
      static void setChar​(Object array, int index, char value)
      Sets array[index] = value.
      static void setDouble​(Object array, int index, double value)
      Sets array[index] = value.
      static void setFloat​(Object array, int index, float value)
      Sets array[index] = value.
      static void setInt​(Object array, int index, int value)
      Sets array[index] = value.
      static void setLong​(Object array, int index, long value)
      Sets array[index] = value.
      static void setShort​(Object array, int index, short value)
      Sets array[index] = value.