00:01
In this video, we will write a program that displays welcome to java five times.
00:06
I've already created the class, which i've named exercise, as well as the main method within this class.
00:16
In this main method, we will start by initializing an integer variable count and assigning it to zero.
00:26
To clarify, we could initialize count and then assign it to zero on two different lines.
00:33
However, it is easier to initialize and assign the value at the same time.
00:43
Next, we'll want to create a while loop, which is a control flow statement that allows code to be executed repeatedly based on a given lean condition inside the parentheses.
00:58
So because we want to print five times, we'll say, while count is less than five, because count starts at 0, 0, 1, 2, 3, and 4 will be able to enter the while loop.
01:19
But those will be 5 different iterations.
01:26
After this definition, we'll use brackets to encompass the code we want to put in the while loop.
01:42
We want to print welcome to java.
01:50
Five times, we want to end the statement again with a semicolon...