Choose
If the program only executes sequentially, the program's behavior may be much simpler, but it will also lose most of its powerful features and highlights.
It is the " branch " that breaks the rigid situation of sequential execution and injects real vitality into the program.
The branches in Java are mainly provided by the selection and looping statements, and their syntax is basically the same as the C language.
If...else ... I'm afraid it's the most familiar to us. It has many forms of expression.
if (conditional) statement;
Or
if (condition) {
Statement 1;
Statement 2;
...
}
Some coding specifications require that even if there is only one statement, it should be enclosed in curly braces.
Or
if (condition) {
Statement
}
else {
Statement
}
Or
if (condition) {
Statement
}
else if (condition 2) {
Statement
}
else if (condition 3) {
Statement
}
else{
Statement
}
A,b,c the largest number of three numbers in a variety of styles.
Getting Started with Java (4)--Process Control