Change the lineif (answerColumns[2] == "YN") {toif ( answerColumns[2].equals( "YN" ) {with == you are comparing the address value of objectsor the value of primatives.