Object cannot be compared with the '==' operatorUse the equals() method of the String class.Replace your statement,if (answerColumns[2] == "YN") {with this,if (answerColumns[2].equals("YN")) {