In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to understand the control statement of JAVA, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
I. process control
The sequential structure is executed sequentially according to the sequence of the code.
II. If statement
Format:
If (relational expression 1) {
sentence aspect 1
}
else if (Relational expression 2) {
sentence aspect 2
}
...
else {
sentence style naugh1
}
III. Switch statement
Format:
Switch () {
case value 1:
sentence aspect 1
break
case value 2:
sentence aspect 2
break
...
defult:
sentence style naugh1
break
}
Note:
1.defalt is equivalent to else, but the break in it is not written.
two。 The following picture shows how to penetrate case and experience it slowly.
In fact, if there is no break after the body of the case statement, it will skip the next judgment and execute it down until the end of the break or switch statement.
IV. For Loop statement
Format:
For (initialization statement; conditional judgment statement; conditional control statement) {
loop body statement
}
Fifth, while loop statement
Format:
While (conditional judgment statement) {
loop body statement
conditional control statement
}
6. Do... While loop statement
Format:
Do {
loop body statement
conditional control statement
} while (conditional judgment statement)
It is equivalent to the first and second version of the while cycle!
Jump control statement
Proper use of continue and break
VIII. Loop nesting
There is a cycle in the cycle. Jianghu people are called "infinite dolls".
IX. Random
This is the answer to the question on how to understand the control statement of JAVA. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.