循环就是给一个能结束的重复代码块
/**
*
* @author suifeng
* @since java 1.7
*
*/
public class test1 {
static int loop(int a)
{
if(a<1)
return 1;
//do some
return loop(a-1);
}
public static void main(String[] args) {
loop(10);//递归循环
for(;;)
{
break;
}
for (int i = 0; i < 100; i++) { //for
//do some
}
int[] aa = new int[100];
for (int at : aa) { //foreach
//do some
}
int a=0;
while (a++<10) { //while
//do some
}
do{ //do while
//do some
}while(a-->0);
}
}