Java Array.getByte(Object array, int index)

Syntax

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

public static byte getByte(Object array,  int index)   
            throws IllegalArgumentException ,    
                   ArrayIndexOutOfBoundsException

Example

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


import java.lang.reflect.Array;
/*from  ww  w.j ava 2 s.  co m*/
public class Main {
  public static void main (String args[]) {
    byte[] array = new byte[]{1,2,3};
    
   
    byte value = Array.getByte(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