S1/using Java to understand program logic/05-loop Structure (i)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.