Array object methods java

Class Array

Array permits widening conversions to occur during a get or set operation, but throws an IllegalArgumentException if a narrowing conversion would occur.

Method Summary

Sets the value of the indexed component of the specified array object to the specified boolean value.

Methods declared in class java.lang.Object

Method Details

newInstance

Creates a new array with the specified component type and length. Invoking this method is equivalent to creating an array as follows:

int[] x = ; Array.newInstance(componentType, x);

newInstance

Creates a new array with the specified component type and dimensions. If componentType represents a non-array class or interface, the new array has dimensions.length dimensions and componentType as its component type. If componentType represents an array class, the number of dimensions of the new array is equal to the sum of dimensions.length and the number of dimensions of componentType . In this case, the component type of the new array is the component type of componentType . The number of dimensions of the new array must not exceed 255.

getLength

get

Returns the value of the indexed component in the specified array object. The value is automatically wrapped in an object if it has a primitive type.

getBoolean

getByte

getChar

getShort

getInt

getLong

getFloat

getDouble

set

Sets the value of the indexed component of the specified array object to the specified new value. The new value is first automatically unwrapped if the array has a primitive component type.

Читайте также:  Http kbs spb sudrf ru modules php

setBoolean

public static void setBoolean (Object array, int index, boolean z) throws IllegalArgumentException, ArrayIndexOutOfBoundsException

Sets the value of the indexed component of the specified array object to the specified boolean value.

setByte

setChar

setShort

setInt

setLong

setFloat

setDouble

Report a bug or suggest an enhancement
For 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. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Оцените статью