do while loop jva code example
Example 1: what is a do while loop in java
do {
//something you want to execute at least once
} while (someBooleanCondition);
Example 2: 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);
}
}