No need to nest the loops!
What tfguy44 shown is enough.
If you just want to check that the word is really in both files, set a boolean to true when you find it in the first file (and use break to exit the loop early), set another boolean to true in the second loop (break there too), and at the end, if both boolean are true, add the word to an array list that you will save when all your searches are finished.