

Java array license#
Use is subject to license terms and the documentation redistribution policy. Arrays are index based data structure so they allow random access to elements, they store. It is a data structure which is used to store finite number of elements and all elements must be of similar data type. Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.Ĭopyright © 1993, 2022, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.Īll rights reserved. An array is a container object that holds a fixed number of values of a single type in a contiguous memory location.
Java array code#
set(, int, )įor further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.The length of the specified array See Also: Primitive widening conversion ArrayIndexOutOfBoundsException - If the specified indexĪrgument is negative, or if it is greater than or equal to To the underlying array's component type by an identity or a Is not an array, or if the specified value cannot be converted Is null IllegalArgumentException - If the specified object argument

Parameters: array - the array index - the index into the array d - the new value of the indexed component Throws: NullPointerException - If the specified object argument Sets the value of the indexed component of the specified array The specified dimensions argument is negative. NegativeArraySizeException - if any of the components in The new array Returns: the new array Throws: NullPointerException - if the specifiedĬomponentType argument is null IllegalArgumentException - if the specified dimensionsĪrgument is a zero-dimensional array, if componentType is Void.TYPE, or if the number of dimensions of the requested array

Type of the new array dimensions - an array of int representing the dimensions of Parameters: componentType - the Class object representing the component The number of dimensions of the new array must notĮxceed 255. In this case, theĬomponent type of the new array is the component type of Number of dimensions of the new array is equal to the sumĭimensions of componentType. Represents a non-array class or interface, the new arrayĬomponentType represents an array class, the With the specified component type and dimensions.
