Java Array.getLong(Object array, int index)

Syntax

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

public static long getLong(Object array,  int index)   
            throws IllegalArgumentException ,    
                   ArrayIndexOutOfBoundsException

Example

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


import java.lang.reflect.Array;
/* www .  ja v a 2  s .  c om*/
public class Main {
  public static void main (String args[]) {
    long[] array = new long[]{1L,2L,3L};
    
   
    long value = Array.getLong(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