实例20 使用while循环语句与自增运算符循环遍历数组

package wjf;
import java.util.Scanner;
public class wjf1{
	public static  void main(String[] args){   
		//创建鸟类数组
	    String[]aves=new String[]{"白鹭","黄鹂","鹦鹉","乌鸦","喜鹊","布谷鸟","斑鸠","百灵鸟"};
	    int index=0;
		  System.out.println("我的花园里有很多鸟,大约包括:"); 
	    while(index<aves.length){
		  System.out.println(aves[index++]);
		}
	}
}

  

原文地址:https://www.cnblogs.com/wjf-110120/p/10665141.html