CSC300: functions [5/6] Previous pageContentsNext page

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
package algs11;
import stdlib.*;
public class Hello {
  public static void main (String[] args) {
    Trace.drawSteps (); 
    Trace.run ();
    f (0);
    g (0);
  }
  public static void f (int i) {
    StdOut.println (i);    
  }
  public static void g (int i) {
    if (i < 3) {
      StdOut.println (i);
      g (i + 1);
    }   
  } 
}

Method calls are shown as red boxes

Method name and line number are listed

Arrow shows where the function will return to

Previous pageContentsNext page