Implementing an equals method recursively
问题 Basically, I need to compare two arrays and check if they have the same values in the same positions (recursively of course). I get an error with my current code: Array out of index exception:20 The code I have right now looks as follows: private boolean equalsHelper(int[] first, int[] second, int iStart, int iEnd){ if (first[iStart] == second[iStart]){ if (equalsHelper(first,second,(iStart+1),iEnd)) { return true; } } if (iStart == iEnd){ return first[iEnd] == second[iEnd]; } return false; }