day2020.12.02
笔记:
一,分支结构—2
1.1 if(){}
没有大括号,可以在一些单个情况中使用
if(age>10) System.out.println("我还是曾经那个少年");
1.2 if(条件){
------
}else if(){
------
}else if(){
------
}else {
------
}
1.3 switch case
switch(string/整形){
case a:
----
case b:
----
case c:
----
default:
----
}
二,循环
2.1 while
while(条件){
执行操作
}
2.2 do...while()