Java Tutorial - 10 - The While Loop

preview_player
Показать описание

Learn how to use the while loop in java programming to control program flow.
Рекомендации по теме
Комментарии
Автор

Thank you, was facing a lot of problems regarding while loops.
Subscribed!

nikhilmanoj
Автор

2 things to point out. A for loop is used when the the number of iterations is fixed. If the number of iterations is not fixed then use the while loop and the 2 things is a while loop will execute the code block at least one time before checking if the condition is true.

davidcooper
Автор

Doesn't work for me for some reason...

public class LoopsApp {
public static void main(String[] args) {
char letter = "A";

while (letter <= "Z")
{
System.out.println("The letter is: " + letter);
letter++;
}
}
}

java: bad operand types for binary operator '<='
first type: java.lang.String
second type: java.lang.String

java: bad operand type java.lang.String for unary operator '++'

nick_
Автор

hello!
how to do this in java
xooo
xxoo
xxxo
xxxx

dafina
Автор

it was hard to watch. The video isn't in focus

grayfan