There are 3 ways to implement the loop structure in a Java program: the while loop structure, the do-while loop structure, and the for loop structure.
How to debug a program
(1) parsing errors, setting breakpoints.
Toggle Breakpoint or double-click on the left sidebar of the line of code
(2) Start debugging, Single step.
In Debug view, pressing the F5 key or the F6 key are all stepping, and their differences are as follows.
Pressing the F5 key " Step Into "will enter the internal execution of the bank code, such as inside the method.
Press F6 to " step Over ", execute only our code, and then skip to the next line of code when executed.
You can observe the values of variables in the variable view while stepping, and you can open the variable view by selecting "window" → "Show View" → "Variables" option, and when the value of the variable changes, the background color of the row of the variable and variable is yellow. To remind you of your attention.
S1/using Java to understand program logic/05-loop Structure (i)