Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

do statement java

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);
    }
}
Source by beginnersbook.com #
 
PREVIOUS NEXT
Tagged: #statement #java
ADD COMMENT
Topic
Name
6+5 =