It would be REALLY helpful if you provided the full code of the routine, the error received, what netbeans told you to do along with the result
Just to the naked eye with what you have
if( (word1 != word2) && (word1 != word3) && (word 2 != word3) )
ALSO No definition seen for "outputString"
AND No closing "}" for the "then" portion of the statement