The first stage: JAVA Quick Start (forty-sixth lesson: JAVA control statement)

     We need to learn this lesson start flow control statements, flow control is used to control the execution order of statements for each statement in the program statement, the compositions may be able to complete certain functions statements into small logic module. Control statements into three categories: the order selection and iteration.

Note:

Know these three control statements, basically the whole logic of reality can be achieved!

E.g:

      "Sequential structure" represents "first perform a, then execute b" is logical. For example, to find a girlfriend, to give his girlfriend a call; before engagement and then marriage;

      "Select structure" on behalf of "if ... then ..." logic. For example, if you call a girlfriend, then quickly answer the phone; if you see a red light, you stop;

      "Loop structure" stands for "if ..., then continue ..." logic. For example, if the girlfriend did not get through the phone, then resume play once; if you do not find people like, then stop searching.

      Front explain the procedures are performed in sequence structure ,, that is written in the order of each statement, this is not our focus, so the focus of this chapter is to study the "Select Structure" and "loop structure."

      Amazingly, all three flow control statements can represent all things! Do not believe, you can try to split all kinds of things you encounter. In fact, any software programs and, to a small practice, a large operating system, are essentially a "variable, select statements, looping statements" component.

      The three basic logic structure of mutual support, which together constitute the basic structure of the algorithm, no matter how complex logical structure, can be expressed through them. Programs of the two structures can solve all problems, so any kind of high-level languages ​​have these two structures.

      So, the lesson is that we truly entered the programming profession "threshold", is a "program ape" and "tickets." 

Published 49 original articles · won praise 6 · views 10000 +

Guess you like

Origin blog.csdn.net/ZGL_cyy/article/details/104091807