CSC300: drawStepsOfMethod [6/6] Previous pageContents

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
package algs11;
import stdlib.*;
public class Hello {
  public static void main (String[] args) {
    Trace.drawStepsOfMethod ("f"); 
    Trace.drawStepsOfMethod ("g"); 
    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);
    }   
  } 
}

drawStepsOfMethod() causes a drawing to be created at every step of the named method.

drawStepsOfMethod() can be called more than once.

Previous pageContents