嵌套
class ForForDemo
{
public static void main(String[] args)
{
//大圈套小圈思想:对于一种重复情况的每一次重复都对应着另外一种情况的多种情况
for(int x=0;x<3;x++) //外循环
{
for(int y=0;y<4;y++) //内循环 先完成内循环
{
System.out.println("x="+x);
}
}
}
}
class ForForDemo
{
public static void main(String[] args)
{
/*
*****
*****
*****
*****
*/
for(int x=0;x<4;x++) //总共四行,所以定义x让其循环四次
{
for(int y=0;x<5;y++) //每行有五个,所以定义y让每行里的单项进行循环
{
System.out.print