Java Array.setLong(Object array, int index, long l)

Syntax

Array.setLong(Object array, int index, long l) has the following syntax.

public static void setLong(Object array,  int index,  long l)   throws IllegalArgumentException ,    ArrayIndexOutOfBoundsException

Example

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


import java.lang.reflect.Array;
import java.util.Arrays;
//from  w w  w. j  a v  a  2s  .  c  o  m
public class Main {
  public static void main (String args[]) {
    long[] array = new long[]{1L,2L,3L};
    
    Array.setLong(array, 1, 9999999999999L);
    
    System.out.println(Arrays.toString(array));


  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang.reflect »




Array
Constructor
Field
Method
Modifier
ParameterizedType
TypeVariable