This is my code and I am trying to get the for loop to come back invalid if the courseCode is not valid. I tried doing: if (!newCourseCode.contains(codeArray.get(i))
if (!newCourseCode.contains(codeArray.get(i))