Click here to Skip to main content
14,302,114 members
Rate this:
Please Sign up or sign in to vote.
See more:
if( (word1 != word2) && (word1 != word3) && (word 2 != word3) ) {
outputString = outputString + "\n\nYou have won $0";

I am getting an error code here. please help me :(

What I have tried:

what netbeans has told me to do.
Posted
Updated 25-Oct-18 20:29pm
Comments
Richard Deeming 25-Oct-18 14:22pm
   
"I am getting an error code here."

And you didn't think we'd need to see the details of that error code?

Click the green "Improve question" link and update your question with a proper description of the problem. Include the full details of the error, and the declarations of the variables you're using.
Member 14032987 25-Oct-18 17:22pm
   
I FEEL LIKE AN IDIOT. Thank you
Rate this:
Please Sign up or sign in to vote.

Solution 1

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) )
// look at the third comparison: "word 2"       ^^^
ALSO No definition seen for "outputString"
AND No closing "}" for the "then" portion of the statement
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

As an additional observation, please note: Java string comparison should be performed using the equals[^] method, not the == operator. See, for instance, How do I compare strings in Java? - Stack Overflow[^].
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100