+ 1
Why doesn't this work and how can I get this to work?
for(int x=10; x<=100; x=x+10) { if(x == 30 && x == 50) { continue; } System.out.println(x); } /* Should output 10 20 40 60 70 80 90 100 */
2 Answers
+ 4
"x == 30 && x == 50" will never be true because x can't be 30 and (&&) 50 at the same time. You probably want to use || (or)
+ 1
Oh yes that works, thank you very much im just starting to learn Java