Only If statement | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Only If statement

if there is only if,it will stop when the first false happen!

24th Mar 2020, 2:00 PM
neyo
neyo - avatar
3 Answers
+ 3
neyo yes Cause there is no else condition to perform alternative part. //in this case it has no output if(false) { System.out.println("Hello world"); } //this will print Hello World if(false) { System.out.println("Hello"); }else{ System.out.println("Hello world"); }
24th Mar 2020, 2:15 PM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
+ 2
Is this a question?
24th Mar 2020, 2:12 PM
HonFu
HonFu - avatar
0
it is a remark
25th Mar 2020, 2:50 PM
neyo
neyo - avatar