while ( 外层循环条件 ){????????//外层循环操作????????while ( 内层循环条件 ){????????????????//内层循环操作????????}????????//外层循环操作}while ( 外层循环条件 ){????????//外层循环操作????????for ( 循环变量初始化 ; 内层循环条件 ; 循环变量更新 ){????????????????//内层循环操作????????}????????//外层循环操作}// 省略其他循环结构组合
****************************************
public static void main ( String [] args ) {????????for ( int i = 0 ; i < 4 ; i ++ ){ // 外层循环控制行数????????????????for ( int j = 0 ; j < 10 ; j ++ ){ // 内层循环控制列数????????????????????????System . out . print ( "*" );????????????????}????????????????System . out . println ();????????}}
*********** &&&&&&&& ** &&&&&&&& ***********
public static void main ( String [] args ) {????????for ( int i = 0 ; i < 4 ; i ++ ){????????????????for ( int j = 0 ; j < 10 ; j ++ ){????????????????????????if ( i == 0 || i == 3 || j == 0 || j == 9 ){????????????????????????????????System . out . print ( "*" );????????????????????????} else {????????????????????????????????System . out . print ( " " );????????????????????????}?????????????????}????????????????System . out . println ();????????}}