fork download
  1. Public class while loop example
  2. {
  3. Public Static Void loop untill five()
  4. {
  5. Integer counter=1;
  6. While(counter<=5)
  7. System.debug('counter:'+counter);
  8. Counter++;
  9. }
  10. }
  11. }
Success #stdin #stdout #stderr 0.01s 8888KB
stdin
Standard input is empty
stdout
Object: UndefinedObject error: did not understand #while
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #while (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:3: parse error, expected '}'