Hi,
Am new to this forum..I am preparing for
scjp 6..I have a doubt in the following code..
I found that there is an error in line 6,because we can't input an array into an int..But they have given its correct in the scjp 6 (kathy sierra) book , self
test section question number 10..Please clear my doubt..correct me if am wrong..Thanks in advance..
(In the book)They have given this as answer : 1 1 3 3 9 9
public class Circles {
4. public static void main(
String[] args) {
5. int[] ia = {1,3,5,7,9};
6. for(int x : ia) {
7. for(int j = 0; j < 3; j++) {
8. if(x > 4 && x < 8) continue;
9. System.out.print(" " + x);
10. if(j == 1) break;
11. continue;
12. }
13. continue;
14. }
15. }
16. }
Thanks,SR