User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







java:loops:do

do

do {
 command;
} while (condition);

a do loop will run while a condition is false

example of do loop in java

package codereferececomjava;
 
public class CodeRefereceComJava {
 
    public static void main(String[] args) {
 
        int i=4;
 
        do {
         i++;
        } while(i==4);
 
        System.out.println("i is :" + i );
    }
}

output of do

  i is :5

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
java/loops/do.txt · Last modified: 2024/02/16 01:04 (external edit)

Impressum Datenschutz