获取集合值的下标 //目标集合 List<String> testList = new ArrayList<>(); //下标 int top = 0; for(int i = 0; i < testList.size(); i++){ if("aaa".equals(testList.get(a))){ top = a; } }