Java Tutorial for Beginners - 11 - Do-While loop

preview_player
Показать описание
In this tutorial we will discuss the Do-While loop and it's differences and similarities to the while loop.

Рекомендации по теме
Комментарии
Автор

Hello,
In dowhileloop,
I deleted the condition bottomNumber++;
and run the program when topnumber was 10 and bottomNumber was 11. It show me one result.
But when I try to run the program with topNumber 10 and bottomNumber 1. It didn't 
show any result.( with deleted condition bottomNumberr++;).

sahilkatia
Автор

please teach us how to make data base using java!

sirnic
Автор

Edward I notiuced that you seem to prefer to write in the "print" statement over the "println" statement. You prefer to see the output all on o ne line?

steveburrus
Автор

Why would you ever want to use a do while loop? Is it to get it to run at least once? What is one example you'd want that to happen?

quynhessence
Автор

Thanks for another good video, which I've given a thumbs-up. Is one of the differences between the while loop and the do-while loop that you have to put a semi-colon after the while condition?

seanfl
Автор

what happened to the do loop tutorial !?

JakeCastle
Автор

My program didn't work before I didn't put" bottomNumber++" (in my case "donjiBroj++") after "while" function.

class doWhile {
public static void main (String[] args) {

int gornjiBroj = 15;
int donjiBroj = 16;

do
System.out.print ("Ovo je loop!");


while (donjiBroj < gornjiBroj);
donjiBroj++;
}
}

So, EJ Media what was that all about? I mean, compiler sent me that it expects "while" right after "do".

matijaninkovic
Автор

is topNumber = topNumber + 1; an alternative to topNumber++;?

alexshi
Автор

public static void main(String[] args)
{
int i =11;
do
{
System.out.println("The number is:" +i);
i++;
}
while(i<10);
The output is:11

tejastoley
Автор

mr.Ej please explain when to put curly braces!... thanks

Project-benc
Автор

My loop keeps going on and on...

class dowhile {
public static void main (String[] args) {

int topNumber = 15;
int bottomNumber = 1;

do
{
System.out.print ("This is a loop");

}
while (bottomNumber < topNumber);
}
}

ammarsadeq