Return | Method | Summary |
---|---|---|
static Object | get(Object array, int index) | Returns the value of the indexed component in the specified array object. |
static boolean | getBoolean(Object array, int index) | Returns array element as a boolean. |
static byte | getByte(Object array, int index) | Returns array element as a byte. |
static char | getChar(Object array, int index) | Returns array element as a char. |
static double | getDouble(Object array, int index) | Returns array element as a double. |
static float | getFloat(Object array, int index) | Returns array element as a float. |
static int | getInt(Object array, int index) | Returns array element as an int. |
static long | getLong(Object array, int index) | Returns array element as a long. |
static short | getShort(Object array, int index) | Returns array element as a short. |
import java.lang.reflect.Array;
import java.util.Arrays;
public class Main {
public static void main(String[] argv) throws Exception {
int[] array = { 1, 2, 3 };
// Get the value of the third element.
Object o = Array.get(array, 2);
System.out.println("o:"+o);
}
}
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |