RUVIDEO
Поделитесь видео 🙏

while loop in java смотреть онлайн

Java tutorial for beginners playlist
https://www.youtube.com/playlist?list=PL6n9fhu94yhWizLudXueXf16yJzlwNrSc

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1

Syntax:
while (condition) {
statement-1;
statement-2;
:
}

While is entry controlled loop
1. If condition is true, only then statements are executed
2. Loop gets executed zero or more times
3. Loop keeps executing till condition becomes false
4. Do not forget to ensure termination of loop

do while loop syntax:
do {
statement-1;
statement-2;
:
} while (condition);

do-while is exit controlled loop
1. Statements get executed first and then condition gets evaluated
2. If condition is false initially, loop will get executed once
3. Loop keeps executing till condition becomes false

break statement syntax:
break;

1. Gets control out of the loop
2. Breaks out immediately
3. Control falls to statement after loop
4. Stops only the loop in which it resides

continue statement syntax:

continue;

1. Immediately stops current iteration
2. Jumps to next iteration
3. Helps in ignoring certain iterations

We have continue statement in java. The continue keyword can be used in any of the loops. It causes loop to immediately stop the current iteration and immediately jump to next iteration

int sum = 0;
for (int i = 1; i [= 100; i++) {
if (i%2 == 0) {
continue;
}
sum += i;
}

# Program 1

public class BreakDemo {

public static void main(String[] args) {

String string = "This is a long long string";
int numberOfOs = 0;
for (int i=0; i[string.length(); i++) {
if (string.charAt(i) == 'o') {
numberOfOs++;
System.out.println(" **** o found");
continue;
}
System.out.println("This is not o");
}
System.out.println("Number of Os " + numberOfOs);
}

}


# Program 2
package com.training.java;

import java.util.Scanner;

public class WhileDemo {

public static void printLine() {
int numberOfAsterisks = 50;
while (numberOfAsterisks ]= 0) {
System.out.print("*");
numberOfAsterisks--;
}
System.out.println();
}

public static void main(String[] args) {
printLine();

Scanner scanner = new Scanner(System.in);
int input;
do {
System.out.print("Enter a number (-1 to exit) : ");
input = scanner.nextInt();
if (input [= 0) {
System.out.println("Seems you are not interested !!");
}
else if (input%2 == 0) {
System.out.println("You entered an even number");
}
else {
System.out.println("You enetered an odd number");
}
} while (input != -1);

printLine();
}
}

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «while loop in java» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.