Java process control: sequential structure

Time:2020-11-25

1、 Process control

  • In JavaProcess control statementIt can be classified as follows:Sequence structure, choice structure and circulation structure。 These three structures are enough to solve all the problems!

2、 Sequential structure

Description:

  • Java process controlBasic structureIt’s a sequential structure. Unless otherwise specified, java code isIn order, statements and code blocks are executed from top to bottom
  • Sequence structure is the simplest algorithm structure. It is a basic algorithm structure that any algorithm cannot do without.
  • The embodiment of sequence structure in the program flow chart is to connect the program frame with the flow line from top to top, and execute the algorithm steps in sequence.

Example:

/*Follow the top-down order! Print in turn. * /
public static void main(String[] args) {
    System.out.println("Hello1");//Hello1
    System.out.println("Hello2");//Hello2
    System.out.println("Hello3");//Hello3
    System.out.println("Hello4");//Hello4
    System.out.println("Hello5");//Hello5
}