CIS 3020 Part 6

From In The Wings
Revision as of 10:46, 13 April 2007 by Jka (talk | contribs)
Jump to navigation Jump to search

Consider the following two methods:

public void count1(int x) {
  if (X <= 0) {
    System.out.println(x);
  } else {
    System.out.println(x);
    count1(x-1);
  }
}
public void count2(int x) {
  if (X <= 0) {
    System.out.println(x);
  } else {
    count2(x-1);
    System.out.println(x);
  }
}