problem about using "while"

i'm learning java programing, i want to use while term but there is an error : illegal start of type :( what can i do?

public class WhileOrnek {

int i = 0 ;

while (i < 5 ) {

System.out.println("i = " + i);

i++ ;

System.out.println("Congratulation! ");

}

}

where is the mistake?

[344 byte] By [blackeaglea] at [2007-10-3 1:02:11]
# 1

Hai Blackeagle,

It seems to me that u are just started learning Java is it?. any way the mistake is u cannot call System.out.println() directly in the class. Instead, u must first write the code inside a method and later execute it inside main or u can directly write the code inside method!

BecksForuma at 2007-7-14 17:58:18 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...