Java Array.getBoolean(Object array, int index)

Syntax

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

public static boolean getBoolean(Object array,
                                             int index)    
            throws IllegalArgumentException ,     
                   ArrayIndexOutOfBoundsException

Example

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


//from  w  w  w .j a  v a2s. c o m
import java.lang.reflect.Array;

public class Main {
  public static void main (String args[]) {
    boolean[] array = new boolean[]{true,true,true};
    
   
    boolean value = Array.getBoolean(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