Home » Java Array setFloat() Method

Java Array setFloat() Method

by Online Tutorials Library

Java Array setFloat() Method

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

Syntax

Parameter

array – the array

index – the index into the array

f – the new value of the indexed component

Returns

Does not return any value.

Throw

NullPointerException

IllegalArgumentException

ArrayIndexOutOfBoundsException –

NegativeArraySizeException

Example 1

Test it Now

Output:

2.4000000953674316  , 7.400000095367432  , 9.399999618530273    

Example 2

Test it Now

Output:

8.0  9.0  10.0  

Java Array setFloat() Method

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

Syntax

Parameter

array – the array

index – the index into the array

l – the new value of the indexed component

Returns

Does not return any value.

Throws

NullPointerException

IllegalArgumentException

ArrayIndexOutOfBoundsException –

NegativeArraySizeException

Example 1

Test it Now

Output:

276657  , 76576576  , 9768768  

Example 2

Test it Now

Output:

88787  88788  88789  
Next TopicJava Array Class

You may also like