Is this what you want to do:
Compare one item from the first list against all the items in the second list
If that item from the first list is not found after looking at all the items in the second list, then print a message
To do that you need to use a boolean variable, for example: matchFound that is initialized to false.
Then search the for one item from the first list against all the items in the second list.
If a match is found, the set matchFound to true.
After the end of the search loop, if matchFound is false, then print a message saying no match was found
For example:for (Item1 item1 : firstList) { boolean matchFound = false; for(Item2 item2 : secondList) { if(item1 == item2) { matchFound = true; // remember } } if(!matchFound) { print item1 not found in secondList } }