0

public class whileLoop { public static void main(String[ ] args) { int a = 10; while(a < 20); System

pls is anytin wrong wt dis code?

23rd Jun 2017, 8:59 AM
Goodnews Oburu
Goodnews Oburu - avatar
2 Réponses
0
Yes, you have infinite while loop. You need to put some code below while, for example: while(a<20) { System.out.print( a ); a--; } Note: -System is a final class from the java.lang package. -out is a class variable of type PrintStream declared in the System class. -print is a method of the PrintStream class.
23rd Jun 2017, 9:39 AM
Majstor_Gile
Majstor_Gile - avatar
0
20
6th Dec 2024, 2:48 PM
Shubam Kanchan
Shubam Kanchan - avatar