+ 1
Java - while
How can I use operators in while methad?
11 Antworten
+ 3
Manasbek Abdugani uulu
while is not a method it's a loop
Loops in Java
1 - for - for fix iteration
2 - while - until condition is true
3 - do while - first do then check condition
Using these loop we can solve your problem.
for (int i = 1; i <= down; i++) {
result *= i;
}
while (down > 0) {
result *= down--;
}
do {
result *= down--;
} while(down != 0);
https://code.sololearn.com/cpMtpshA3D7q/?ref=app
+ 4
abol
forEach is also in Java but in Java 8 Stream API
For example:
LongStream ls = LongStream.of(1000L, 12000L);
ls.forEach(System.out::println);
+ 2
Thank you so much bro Allah bless you 🤲🤲🤲😊
I spent for this loop at least 4 hours and I couldn't find it😁
+ 2
Hi
+ 2
Hi
+ 1
Please someone help me
+ 1
Manasbek Abdugani uulu
Which operators?
+ 1
Thank you to everyone 😊😊😊
+ 1
class WhileDemo { public static void main(String[] args){ int count = 1; while (count < 11) { System.out.println("Count is: " + count); count++; } } }
0
Multiplication
0
I need to multiplicate decrement number in while method