posted 6 years ago
The continue statement (without using a label) will end the current iteration, and start again the evaluation of the expression boolean of the loop that the continue statement belongs to. On the other hand, the break statement (again, without using a label) will end the current iteration and break out the loop that it belongs to, transfering the flow of control to the outer statement, which is, in this case, the outer for loop.
So, with that being said, grab a paper and a pencil, and write down the x and j values for each iteration. If the x value matches the boolean expression of the first if statement, apply the continue statement as I said before. If the j value matches the second if statement, apply the break statement. At the end, you will have the output. Remember to analyze each value for each iteration.
Pay attention to the if statements, because they control the flow of the loops, so the System.out.print() inside the inner loop depends on them.
You might notice that the continue statements in the last line of each loop aren't necessary, since they will end the current iteration, but there is no code after them, so the iteration would end anyway.