You could iterate over these two files line by line using a BufferedReader
the readLine()
method returns a string representation of each line which can then be checked for equality.
The index of any unequal lines can be stored and returned in any way you want.