Can't run a while loop code.(error: package system does not exist) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can't run a while loop code.(error: package system does not exist)

can anyone help me with this code of while loop.. I am unable to run it. It's showing error on "system.out.println" don't know why? public class Program { public static void main(String[] args) { int x = 1; system.out.println("Before the Loop"); while (x<4) { system.out.println("In the Loop"); system.out.println("value of x is" +x); x = x+1; } system.out.println("After the loop"); } }

20th Mar 2017, 8:51 PM
Utkarsh Galav
Utkarsh Galav - avatar
2 Answers
+ 7
the s in "system" should be in caps. Like this: System.out.println(..);
20th Mar 2017, 8:59 PM
Rrestoring faith
Rrestoring faith - avatar
+ 1
thanks bro. faith restored :D :D
20th Mar 2017, 9:00 PM
Utkarsh Galav
Utkarsh Galav - avatar