1. The expression s.charAt(0) will generate an exception if the string is the empty string.
2. Recursive algorithms are easier to design than their corresponding iterative algorithms.
5 Fill in the blank
1. A recursive definition consists of two parts: a recursive part in which the nth value is defined in terms of the (n – 1)st value, and a(n) __________ case which defines a boundary condition.
2. The following formula is used to calculate the __________ of n: n! = n * (n – 1) * (n – 2) * … 1, for n > 0
3. A(n) __________ repetition will occur if a recursive definition is not properly bounded.
4. A recursive __________ controls the progress of the recursion toward its bound.
5. A(n) __________ compiler can convert a recursive method into an iterative mentod when the program is compiled.
5 Multiple Choice
1. What method is called automatically whenever the an applet repaints itself?
2. What method will retrieve the position selected within a menu of a JComboBox?
3. Method call and return in Java, and all other programming languages, uses a
4. A string and a(n) __________ can be divided into its head, the first element, and its tail, the rest of its elements.
5. As each method is called, a representation of the method call is place d on the method call __________.