If query | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 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 ответов
+ 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