Answer:
int x = 1;
while (x <= 7) {
System.out.println("in a loop");
++x;
}
this should work in java
Explanation:
the ++x increments x, so it works lke this:
1. x is 1, prints the thing, then increments x to 2
2. x is 2, prints the thing, then increments x to 3
3. x is 3, prints the thing, then increments x to 4
4. x is 4, prints the thing, then increments x to 5
5. x is 5, prints the thing, then increments x to 6
6. x is 6, prints the thing, then increments x to 7
7. x is 7, prints the thing, then increments x to 8
8. loop stops because 8 is not <= 7
hope this helps :D
btw this could also be done like this using for loop:
for (int x = 1; x <= 7; ++x) {
System.out.println("in a loop");
}