for(int i : index)的意思就是说,遍历index数组,每次遍历的对象用i 这个对象去接收。 相当于: int i=0; //用于接收index数组中的某一个对象 for(int j = 0;j<index.length;j++){ i = index[j]; }