当前位置:网站首页>Process control statement
Process control statement
2022-07-27 16:48:00 【.Null】
Flow control statement
Summary of knowledge points : Flow control statement
One . if...else Statements can be seen as having 4 In the form of :
1) if sentence
if( Boolean expression ){ If the Boolean expression is true Statement to be executed }
2) if...else sentence
if( Boolean expression ){ If the value of a Boolean expression is true} else{ If the value of a Boolean expression is false}
3) if...else if...else sentence
Format : if( Boolean expression 1){ If the Boolean expression 1 The value of is true Execute code }
else if( Boolean expression 2){ If the Boolean expression 2 The value of is true Execute code }
else if( Boolean expression 3){ If the Boolean expression 3 The value of is true Execute code }
else { If none of the above Boolean expressions are true Execute code }
Two . Nested if…else sentence
Format : if( Boolean expression 1){ If the Boolean expression 1 The value of is true Execute code
if( Boolean expression 2){ If the Boolean expression 2 The value of is true Execute code }}
3、 ... and .switch sentence
switch case Sentences have the following rules :
1)switch The variable type in a statement can be : byte、short、int perhaps char、enum. from Java SE 7 Start ,
switch Support string String Type , meanwhile case Label must be a string constant or literal .
2)switch Statements can have more than one case sentence . Every case Followed by a value and colon to compare .
3)case The data type of the value in the statement must be the same as the data type of the variable , And it can only be a constant or literal constant .
4) When the value of a variable is equal to case When the values of the statements are equal , that case Statement after statement begins execution , until break The sentence will jump out switch sentence .
5) When you meet break When the sentence is ,switch Statement termination . The program jumps to switch Statement execution after statement .case The statement does not have to contain break sentence . without break The statement appears , The program will continue with the next case sentence , Until it appears break sentence .
6)switch A statement can contain a default Branch , This branch is usually switch The last branch of the statement ( Can be anywhere , But usually in the last ).default In the absence of case Execute when the value of a statement is equal to the value of a variable .default Branches don't need break sentence . switch( expression ) {
case Expression value 1: Sentence block 1;
break;
case expression N: Sentence block N;
break;default: Sentence block ;}
边栏推荐
- MPC_ ORCA
- 重新配置cubemx后,生成的代码用IAR打开不成功
- 201403-1
- MySQL high version report SQL_ mode=only_ full_ group_ By exception
- 知网、万方数据库免费下载论文------比连接学校内网速度快数倍不止(有的学校万方数据库不支持下载)
- training on multiple GPUs pytorch
- 【论文阅读】Transformer with Transfer CNN for Remote-Sensing-ImageObject Detection
- The difference between select/poll/epoll
- jupyter 创建虚拟环境并安装pytorch(gpu)
- Is low code the future of development? On low code platform
猜你喜欢

Insert pictures in word to maintain high DPI method

OpenCV(四)——图像特征与目标检测

Opencv (V) -- moving target recognition

什么是jsp?

Collection! 0 basic open source data visualization platform flyfish large screen development guide

matlab legend用法

Opencv (I) -- basic knowledge of image
The difference between MVC and MVP and MVVM
![[paper reading] a CNN transformer hybrid approach for coding visual neuralactivity into text](/img/31/d6d7ac43c3170c0d527d88053618c9.png)
[paper reading] a CNN transformer hybrid approach for coding visual neuralactivity into text

Log management
随机推荐
Is low code the future of development? On low code platform
Opencv (II) -- basic image processing
Fast Planner - detailed explanation of kinetic astar
Insert pictures in word to maintain high DPI method
[paper reading] a CNN transformer hybrid approach for cropclassification using multitemporalmultisensor images
Filament Creator材质编辑工具的实现
Polynomial locus of order 5
[paper reading] single- and cross modality near duplicate image pairsdetection via spatial transformer compare
mvc和mvp和mvvm的区别
最大子段和 Go 四种的四种求解
Scala for loop (loop guard, loop step size, loop nesting, introducing variables, loop return value, loop interrupt breaks)
Opencv (III) -- image segmentation
The image displayed online by TP5 is garbled
知网、万方数据库免费下载论文------比连接学校内网速度快数倍不止(有的学校万方数据库不支持下载)
gpt-2 文本生成
[paper reading] a CNN transformer hybrid approach for coding visual neuralactivity into text
Segment tree beats~
Casadi -- detailed explanation of data types and introduction to basic operations
2021-06-02
android中的图片三级缓存