go to previous page   go to home page   go to next page

Answer:

No. You don't know in advance how many integers there will be for any particular starting value.


Method

hail stones

Here is the definition, again:

And here is a method:

  static void hail( long N )
  {
    System.out.print( N + ", ");
    
    if (  )
      return;
      
    else if (  )
    
      hail(  );
      
    else
      hail(  );
  }

The method prints out the current N, then advances to the next by calling itself. When it hits one, it returns to its caller, which returns to its caller, and so on up the chain until the first activation.


QUESTION 15:

Fill in the blanks.