Somme question about my code

Hi everyone.

I’m a beginner in java and i’ve decide to train me with this web site. Firstly, i’m not here to get the solution, I want to find it by myself. I’m with the second puzzle, with Thor and the thundernbolt. I’ve write an instruction like this :
if (testY>0 && testX=0) {

where testY and tesX are of the “int” type. This create the following error : bad operand types for binary operator '&&
if (testY>0 && testX=0).

I don’t understand why, because in my lecture, i’ve read that “&&” is the “AND” operator. So anyone can explain me why i’ve got this error please ?

Thanks a lot ! ^^


the “testX=0” might be the problem, because it’s an assignment. You probably want to test for equality, which is done using “==”.

So the right side of “&&” is not a boolean, which is why you get this message.

Happy coding

I’ve understand.

Thank’s a loot =D !