I am trying to check if an arraylist B contains a string from arrayA with this, but it doesn't work:
String match = arrayA[i];
if (! B.contains(match)) {
outputFile.print(match);
}
Is this because I used the contains() method incorrectly?
Can we put the name of the variable in the contains() method like contains(match) here?
Or do we have to put a string in the contains(), like contains("name")?
ifstatement is negated (indicated by the "!"), meaning that you only print stuff to the file if they DONT match. Are you sure that that's what you want?