The key concepts will employ from the concepts are condition and code block.
Loop mechanics are simple:

"Condition" is the key piece to a loop.
The condition must evaluate to true/false. The code block can be any code.
public void myMethod() {
	while (YOUR-CONDITION) {
		YOUR-CODE
	}
}
Here we hard-code the condition to true, so this is an infinite loop (will loop forever). We do NOT really want to do this.
public void infiniteLoop() {
	while (true) {
		prn("I loop forever!");
	}
}
Here we hard-code the condition to false, so we will loop zero times. In effect, the loop block is skipped.
public void neverEntersLoopCodeBlock() {
	while ("apple".equals("orange")) {
		prn("Nuts, I never get here!");
	}
}
Basically we count up to a number, terminating after we get there. We may call the incremented variable the "loop variable".

👉🏼 Try It

📹 Video

public void loop1to4() {
	//print nums 1 to 4
	int num = 1;
	while (num <= 4) {
		prn("Number: " + num);
		num++;
	}
}
We can also count down to a number. Remember to decrement (--) or we'll be in infinite loop again.

👉🏼 Try It

📹 Video
public void loop4to1() {
	//print 4 to 1
	int num = 4;
	while (num >= 1) {
		prn("Number: " + num);
		num--;
	}
}
It is common to compute a sum over a range.

👉🏼 Try It

📹 Video
public void loopAndSum1to4() {
	//sum nums 1 thru 4
	int num = 1;
	int sum = 0;
	while (num <= 4) {
		sum = sum + num;
		num++;
	}
	prn("Sum: " + sum);
}
We can increment by values other than 1. Here we increment by 10.
public void loopWithVariableIncrement() {
	//sum ints 10, 20, ..., 100 (increment by 10)
	int num = 10;
	int sum = 0;
	while (num <= 100) {
		sum = sum + num;
		num += 10;
	}
	prn("Sum: " + sum);
}
We can send messages for the condition (as long as the message returns a boolean).
public playGame() {
	while (!hasWinner()) {
		playNext();
	}
}