📜  do 语句 java 代码示例

📅  最后修改于: 2022-03-11 14:52:11.647000             🧑  作者: Mango

代码示例3
class DoWhileLoopExample2 {
    public static void main(String args[]){
         int arr[]={2,11,45,9};
         //i starts with 0 as array index starts with 0
         int i=0;
         do{
              System.out.println(arr[i]);
              i++;
         }while(i<4);
    }
}