do while loop java
class DoWhileLoopExample {
public static void main(String args[]){
int i=10;
do{
System.out.println(i);
i--;
}while(i>1);
}
}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);
}
}package com.journaldev.javadowhileloop;
public class JavaDoWhileLoop {
public static void main(String[] args) {
int i = 5;
do {
System.out.println(i);
i++;
} while (i <= 10);
}
}
do {
// loop content
} while (/* condition */);do
{
statement(s);
} while(condition);10
9
8
7
6
5
4
3
2
Also in Java:
- java get annotation value
- how to use lambda in java
- loop and save letters in a string java
- non primitive data types in java
- jquery set data attribute value
- how to crate a list in java script
- connect 2 package in android
- java uuid
- java linked list functions
- string to double java exception
- java swing change label icon
- processing library cassette
- get value textfield java
- BoxLayout java
- write file from a specific location in java
- Enums injava
- java for
- tower of hanoi program in java using recursion
- how to remove a certain string in a arraylist java
- array null pointer java
- number to char java
- how to install java 8 on terminal os
- padding a string with 0 in java
- stack class in java