3/13 Help


#1



My code: This doesn't work for some reason. Can someone tell me what is wrong?


https://www.codecademy.com/courses/learn-java/lessons/data-structures/exercises/arraylist?action=lesson_resume


For.java:3: error: class, interface, or enum expected
public static void main(String[] args) {
^
For.java:5: error: class, interface, or enum expected
for (int waterLevel = 0; waterLevel < 7; waterLevel++) {
^
For.java:5: error: class, interface, or enum expected
for (int waterLevel = 0; waterLevel < 7; waterLevel++) {
^
For.java:9: error: class, interface, or enum expected
}
^
For.java:11: error: class, interface, or enum expected
}
^
5 errors


public class For {
  
	public static void main(String[] args) {
		
		for (int waterLevel = 0; waterLevel < 7; waterLevel++) {
			
			System.out.println("The pool's water level is at " + waterLevel + " feet.");
			
		}
		
	}

}


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.