Source of Question2.java


  1: //Question2.java
  2: 
  3: public class Question2
  4: {
  5:     public static void main(String[] args)
  6:     {
  7:         methodB(3);
  8:     }
  9: 
 10:     public static void methodB
 11:     (
 12:         int n
 13:     )
 14:     {
 15:         if (n < 1)
 16:             System.out.println('B');
 17:         else
 18:         {
 19:             //The following two lines are the reverse of
 20:             //what they are in Self-Test Question 1.
 21:             System.out.println('R');
 22:             methodB(n - 1);
 23:         }
 24:     }
 25: }