Here you can find the source of lastIndexOf(Object[] array, Object object)
public static int lastIndexOf(Object[] array, Object object)
//package com.java2s; //License from project: Open Source License public class Main { public static int lastIndexOf(Object[] array, Object object) { if (object != null) { for (int i = array.length - 1; i >= 0; i--) { if (object.equals(array[i])) { return i; }/*www . ja v a 2 s . c o m*/ } return -1; } for (int i = array.length - 1; i >= 0; i--) { if (array[i] == null) { return i; } } return -1; } public static int lastIndexOf(byte[] array, byte value) { return lastIndexOf(toBoxedArray(array), value); } public static int lastIndexOf(char[] array, char value) { return lastIndexOf(toBoxedArray(array), value); } public static int lastIndexOf(double[] array, double value) { return lastIndexOf(toBoxedArray(array), value); } public static int lastIndexOf(float[] array, float value) { return lastIndexOf(toBoxedArray(array), value); } public static int lastIndexOf(int[] array, int value) { return lastIndexOf(toBoxedArray(array), value); } public static int lastIndexOf(long[] array, long value) { return lastIndexOf(toBoxedArray(array), value); } public static int lastIndexOf(short[] array, short value) { return lastIndexOf(toBoxedArray(array), value); } public static Boolean[] toBoxedArray(boolean[] array) { final Boolean[] objectArray = new Boolean[array.length]; for (int i = 0; i < array.length; i++) { objectArray[i] = array[i]; } return objectArray; } public static Byte[] toBoxedArray(byte[] array) { final Byte[] objectArray = new Byte[array.length]; for (int i = 0; i < array.length; i++) { objectArray[i] = array[i]; } return objectArray; } public static Character[] toBoxedArray(char[] array) { final Character[] objectArray = new Character[array.length]; for (int i = 0; i < array.length; i++) { objectArray[i] = array[i]; } return objectArray; } public static Double[] toBoxedArray(double[] array) { final Double[] objectArray = new Double[array.length]; for (int i = 0; i < array.length; i++) { objectArray[i] = array[i]; } return objectArray; } public static Float[] toBoxedArray(float[] array) { final Float[] objectArray = new Float[array.length]; for (int i = 0; i < array.length; i++) { objectArray[i] = array[i]; } return objectArray; } public static Integer[] toBoxedArray(int[] array) { final Integer[] objectArray = new Integer[array.length]; for (int i = 0; i < array.length; i++) { objectArray[i] = array[i]; } return objectArray; } public static Long[] toBoxedArray(long[] array) { final Long[] objectArray = new Long[array.length]; for (int i = 0; i < array.length; i++) { objectArray[i] = array[i]; } return objectArray; } public static Short[] toBoxedArray(short[] array) { final Short[] objectArray = new Short[array.length]; for (int i = 0; i < array.length; i++) { objectArray[i] = array[i]; } return objectArray; } }