Java: Control Flow
Comparison Operators
- >
- \<
- \=
- >=
- \<=
Logical Operators
- &&
- ||
- !
Conditional Statements
If
1 | public class Main { |
等价方式:
1 | public class Main { |
The Ternary Operator
1 | public class Main { |
Switch
1 | public class Main { |
Loops
For
1 | public class Main { |
While
1 | public class Main { |
Do While
1 | public class Main { |
Break and Continue
1 | public class Main { |
For Each
1 | public class Main { |
局限:
- 只能从前往后遍历
- 不能访问索引
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
Anonymous Comment
You don't need to delete empty lines. Comment directly for the best display effect.