Java cyclic statements-general Linux technology-Linux programming and kernel information. The following is a detailed description. Java loop statements include for, while, and do-while. These statements create what we usually call a loop (loops ).
1.switchswitch (expression) {case value 1: statement body 1; Break Case Value 2: statement body 2; Break ... default: statement body N; break;}Format Explanation:Switch indicates that this is a switch statementA) The value
First, the cycle structure:The loop statement can be repeated execution of a piece of code in the case of satisfying the loop condition, which is repeated execution of the code is called the Loop body statement, when the loop body is repeatedly
Java loop structure, java Loop1. If statement format and execution process (3) 1. if statement first format:
If (relational expression ){
Statement body
}
Execution Process:
First, determine whether the relational expression is true or
Sequential structuresequence structure of the program: If there is no process control in the code, the program executes in the written format from the top and the next line, and then executes the next statement after the execution of a statement,
While Loop statement: while (Boolean expression)//Boolean expression value is true on execution loop, otherwise false jumps out of loop {statement } //while cycle, calculate 1 to 100PackageXunhuan; Public classXun { Public Static voidMain (string[
Outline:One, branch structureIfSwitchSecond, the circulationForWhileDo WhileBreakContinueThird, formatted output "printf"--------------------------------------------Switch statementIt is also used for branching, and if it is different, it can only
Keyword break and ContinueIn addition to using break in a switch statement, you can use a break in a loop to immediately terminate the Loop.There are three types of loop statements: while loops, Do-while loops, and for Loops.The whole of a statement
------Java Training, Android training, iOS training,. NET training, look forward to communicating with you! -------"Loop Structure"1 , circular structure Introduction:Loops are executing the same block of code again and again2. Several conditions
Course review:VariableFormat: Data type variable name [= value];A variable must be declared and then assigned before it can be usedOperator:1. Arithmetic operators2. Logical operators3. Relational operators4. Assignment operators5, bitwise operators6
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.