Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Object getNthInArray(Object[] array, int index) {
- int i = 0;
- while (array.length > 0) {
- Object[] array_cp = new Object[array.length-1];
- System.arraycopy(array, 1, array_cp, 0);
- i++;
- if (i == index)
- return array_cp[0];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement