Ask coding questions

← Back to all posts
I have a bad operand type error for binary operator '=='. I can't see the problem.
MaltedWheaties (2)

First type: char
Second type: string

any help would be greatly appriciated

Answered by AlexanderTarn (274) [earned 5 cycles]
View Answer
AlexanderTarn (274)

I am a novice at java, but if you are checking for character, use single quotations instead of double quotations

MaltedWheaties (2)

@AlexanderTarn This totally worked! Thanks for your help Alex :)

AdCharityTester (11)

I'm assuming it works now? Mark @AlexanderTarn's answer correct.

MaltedWheaties (2)

It's not finished yet, but @AlexanderTarn's answer resolved the queried error. I have marked his answer as correct.

AdCharityTester (11)

@MaltedWheaties cool (btw if you're the one who upvoted my account don't cause this is just my testing account for people who utilize repl auth)