Hi Kalpana,
Let us go throught the values of i and j as we understand the code.
class JMM119 {
public static void main (
String[] args) {
int i = 0, j = 9;
do {
if (j < 4) {break;} else if (j-- < 7) {continue;}
i++;
} while (i++ < 7);
System.out.print(i + "," + j);
}}
now as we enter do while for the firdt time
i =0 and j =9
so j = 9 < 4 is true go on this is the
tricky part j-- < 7 is like check if j=9 < 7 and and then decrement j so 9 < 7 is true and then the value of j becomes 8. The continue statement takes the flow to while clause
now here again first i = 0 < 7 is checked it is true and then i is incremented to i = 1;
As j -- and i ++ are postincrement operators.
Similarly the rest of the code is
2 time
8<4
8<7
j = 7
1 < 7
i = 2
3 time
7<4
7< 7 - false
still j = 6
i = 3
3 < 7
i = 4
6<4
6< 7 - false
still j = 5
i = 5
5 < 7
i = 6
5<4
5< 7 - false
still j = 4
i = 7
7 < 7 [B]fasle[B] and so ends the loop but ofcourse incrementing i so
i = 8
and then the print statement is executed printing 8 and 4
4<4
4< 7 - false
still j = 3
i = 7
7 < 7 - [B]fasle[B]
i = 8
now the while loop ends