*使用while循环遍历数组创建索引和自增索引值

package com.chongrui.test;

/*
 *使用while循环遍历数组
 *
 *
 * */


public class test {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
   
        String[] aves = new String[]{"白路","丹顶鹤","百灵"};//创建鸟类数组
        int index = 0;//创建索引
        System.out.println("我家花园有这种各类的鸟");
        while(index<aves.length){
            
            System.out.println(aves[index++]+" ");//自增索引值
        }
        
        
        
        
        
        
    }
    

}
======================

我家花园有这种各类的鸟
白路
丹顶鹤
百灵

原文地址:https://www.cnblogs.com/tantanba/p/6241247.html