Javatpoint Logo
Javatpoint Logo

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





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA