Returns the value of the indexed component in the specified array object, as a
byte
.
package com.logicbig.example.array;
import java.lang.reflect.Array;
public class GetByteExample2 {
public static void main(String... args) {
Byte[] arr = {1, 2, 3, 4};
byte aByte = Array.getByte(arr, 3);
System.out.println(aByte);
}
}
Output
Caused by: java.lang.IllegalArgumentException: Argument is not an array of primitive type
at java.base/java.lang.reflect.Array.getByte(Native Method)
at com.logicbig.example.array.GetByteExample2.main(GetByteExample2.java:14)
... 6 more