New course! Every coder should learn Generative AI!
Try a free lesson+ 12
java doesn't take binary value like that it's not allowed in java. in java conditions must return Boolean true or false and int does not return true or false you can do the code likes this: https://code.sololearn.com/c05mH7VZwVJl/?ref=app
+ 3
It is not allowed in Java.
A condition must return a boolean value for it to be either true or false.
1 and 0 are integer types and cannot be implicitly converted to a boolean.
+ 3
This would work in C Language, but in Java condition must return boolean . Try this :
if (a != 0) {...}