Home » Java Array setInt() Method

Java Array setInt() Method

by Online Tutorials Library

Java Array setInt() Method

The setInt() method of Array class sets the value of the indexed component of the specified array object to the specified int value.

Syntax

Parameter

array – the array

index – the index into the array

i – the new value of the indexed component

Returns

Does not return any value.

Throw

NullPointerException

IllegalArgumentException

ArrayIndexOutOfBoundsException –

Example 1

Test it Now

Output:

2.0  , 7.0  , 9.0 ,  

Example 2

Test it Now

Output:

8  9  10  
Next TopicJava Array Class

You may also like