Here you can find the source of lastIndexOf(String str, String[] path)
private static int lastIndexOf(String str, String[] path)
//package com.java2s; //License from project: Apache License public class Main { private static int lastIndexOf(String str, String[] path) { for (int i = path.length; 0 < i; i--) { if (path[i - 1].compareTo(str) == 0) { return i - 1; }//from www . ja v a 2 s. c o m } return -1; } }