142
Java Array getFloat() Method
The getFloat() method of Array class returns the value of the indexed component in the specified array object, as a float.
Syntax
Parameter
array – the array
index – the index
Returns
the value of the indexed component in the specified array
Throw
NullPointerException
IllegalArgumentException
ArrayIndexOutOfBoundsException
Example 1
Output:
2.2
Example 2
Output:
arr[0] = 1.0 arr[1] = 2.0 arr[2] = 3.0
Next TopicJava Array Class