If query | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

If query

will the following code be evaluated? if(27) System.out.println("Condition true");

16th Jan 2017, 4:31 PM
Jotheeswaran M
Jotheeswaran M - avatar
2 Antworten
+ 2
yes the code will be evaluated to true! any positive integer will be taken as true and the if condition evaluates to true!
16th Jan 2017, 4:34 PM
Jotheeswaran M
Jotheeswaran M - avatar
+ 1
anything non zero = true zero = false therefore, this is true
16th Jan 2017, 4:33 PM
Nikunj Arora
Nikunj Arora - avatar