fork download
  1. public class while loop Example
  2. {
  3.  
  4. Public static void loop until five(){
  5. Integer Counter=1;
  6. while (counter <=5){
  7.  
  8. System.debug ('counter:'+ counter)
  9.  
  10. Counter ++;
  11. }}}
Success #stdin #stdout #stderr 0.01s 8988KB
stdin
public class while loop Example
{

Public static void loop until five(){
Integer Counter=1;
while (counter <=5){

System.debug ('counter:'+ counter)

Counter ++;
}}}
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:4: parse error, expected '}'