Loop structure 1 while loop structure, Do-while loop structure. Loop structure: Two conditions must be met. 1, cycle conditions and cycle operation! While Loop features: First judge, then execute, code specification: Indentation, newline! Flowchart: Start-and-Declare count and assign -count<=50 if False jumps to the end code block. If True, start printing count++! Public static void Main (string[] args) { int count =1; while (count<=50) { System.out.println ("Print section" +count+ "paper"); Count + +; } }
Why you need program debugging
Problem:
In the process of writing a program sometimes errors, but not to find and locate errors, there is no good way?
Analysis:
Read through code or add output statements to find program errors
When the structure of the program becomes more and more complex, special techniques are needed to find and locate errors, which is "program debugging"
What is Program debugging:
int i = 1;
SYSTEM.OUT.PRINTLN ("program debug demo, pay attention to the value of I:");
Step 2: Start debugging
Step 3: Single Step operation
After debugging is started, the code line that runs to the set breakpoint stops clicking the F6 key to step through the program, observing the program's running process
F5: Step Into F6: Single Step Skip
Summary: 1, the purpose of the program debugging?
Identify causes of defects and fix defects
2, the main method of program debugging?
Setting breakpoints, stepping, observing variables
The difference between a while loop and a do-while loop
Different syntax
Different execution order
When the initial condition does not meet the cycle condition
The while loop does not execute at once
Do-while cycle is performed at least once in any case
Summarize:
Java Chapter Fifth