78
Java Array set() Method
The set() method of Array class returns the value of the indexed component in the specified array object, as a short.
Syntax
Parameter
array – the array
index – the index into the array
value – the new value of the indexed component
Returns
Does not return any value.
Throw
NullPointerException
IllegalArgumentException
ArrayIndexOutOfBoundsException –
Example 1
Output:
Before Setting : TutorAspire After Setting : JavaforPoint
Example 2
Output:
obj:3 Array :: [1, 2, 1]
Next TopicJava Array Class