Sololearn: Learn to Code
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
28th Jan 2020, 5:38 AM
Easham Halder
Easham Halder - avatar
+ 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.
28th Jan 2020, 5:37 AM
Avinesh
Avinesh - avatar
+ 3
This would work in C Language, but in Java condition must return boolean . Try this : if (a != 0) {...}
28th Jan 2020, 5:38 AM
voja
voja - avatar