当前位置:网站首页>Judgment statement _switch and case
Judgment statement _switch and case
2022-08-05 05:03:00 【good girl @@@】
[1]Syntax
The value following theswitch can be either a value or an expression, but only a value can follow the case!
switch (value/expression){case value1:statements1 // When the result of the expression/value equals value1, execute the codebreak;case value2:statements2 // When the result of the expression/value equals value2, execute the codebreak;......case valueN:statementsN // When the result of the expression/value equals valueN, execute the codebreak;default :statements // If there is no value equal to the expression/value, execute the code}[2]Comparison process
The switch statement compares the value of the expression with the value in the case clause in turn:
- If the two are equal, execute the following statement segment, and jump out of the entire switch statement when the break keyword is encountered.
- If not equal, continue to match the next case.
- The switch statement contains an optional default keyword, if no equal condition is found in the previous case, the statement following the default is executed
- The comparison process is
congruent!
边栏推荐
- C++ core programming
- LAB 信号量实现细节
- 开发属于自己的node包
- 说说数据治理中常见的20个问题
- 延迟加载js方式async与defer区别
- Homework 8.4 Interprocess Communication Pipes and Signals
- 为什么刚考完PMP,就开始准备软考了?
- Talk about 20 common problems in data governance
- Develop your own node package
- App rapid development and construction experience: the importance of small programs + custom plug-ins
猜你喜欢
随机推荐
What is the function of industrial-grade remote wireless transmission device?
雷克萨斯lm的安全性到底体现在哪里?一起来看看吧
jvm 三 之堆与栈
How to deal with DNS hijacking?
淘宝账号如何快速提升到更高等级
浅析主流跨端技术方案
The solution to the failure to read channel information when dedecms generates a message in the background
Excel Paint
[BJDCTF2020] EasySearch
Use IDEA to connect to TDengine server
[informix] Resolving startup errors and solutions
upload upload pictures to Tencent cloud, how to upload pictures
No regrets, the appium automation environment is perfectly built
bytebuffer use demo
how to measure distance from point to face in creo
Flutter learning 2-dart learning
Day019 方法重写与相关类的介绍
u-boot中的u-boot,dm-pre-reloc
Flutter learning 5-integration-packaging-publish
【informix】解决启动报错大全,以及解决办法




![[BSidesCF 2019] Kookie](/img/29/19e7c244feb86b37ab32a53aa11f25.png)




