fork download
  1. public class WhileLoopExample {
  2. public static void loopUntilFive() {
  3. int counter = 1;
  4. while (counter <= 5) {
  5. System.out.println("counter: " + counter);
  6. counter++;
  7. }
  8. }
  9.  
  10. public static void main(String[] args) {
  11. loopUntilFive();
  12. }
  13. }
Success #stdin #stdout #stderr 0.01s 8996KB
stdin
Standard input is empty
stdout
Object: UndefinedObject error: did not understand #WhileLoopExample
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #WhileLoopExample (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:2: parse error, expected '}'