Java Array.getFloat(Object array, int index)

Syntax

Array.getFloat(Object array, int index) has the following syntax.

public static float getFloat(Object array,int index)
           throws IllegalArgumentException,
                  ArrayIndexOutOfBoundsException

Example

In the following code shows how to use Array.getFloat(Object array, int index) method.


import java.lang.reflect.Array;
//  w  w  w  .ja v a2 s .  c  o  m
public class Main {
  public static void main (String args[]) {
    float[] array = new float[]{1.1F,2.2F,3.3F};
    
   
    float value = Array.getFloat(array, 1);

    System.out.println(value);

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable