Can anyone please explain me the Loop control condition: "Continue" ?! Help me! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone please explain me the Loop control condition: "Continue" ?! Help me!

here is the code: public class Program { public static void main(String[] args) { for(int x=10; x<=40; x=x+10) { if(x == 30) { continue; } System.out.println(x); } } }

15th May 2017, 10:17 AM
Yashna Islam
Yashna Islam - avatar
2 Answers
+ 22
it just skips a turn of the loop.... (the case where x == 30) this will print 10 20 40
15th May 2017, 10:22 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 3
Ya @valentinhacker is right...
15th May 2017, 10:22 AM
Vishnu ks
Vishnu ks - avatar