IF
if(表达式){
}
else if(表达式){
}
else{
}
switch-case
switch(表达式){
case 常量1:
语句;
break;
case 常量2:
语句;
break;
…
default:
语句;
break;
}
for
for(int i=0;i<n;i++){
}
foreach
Collection collection = new ArrayList();
collection.add(123);
collection.add("sss");
collection.add(new Person());
for(Object obj: collection){
System.out.println("obj ="+obj);
}
while
while(表达式){
}
do-while
do{
}while(表达式);