Recursion

If recursion is new to you and you want a slower ramp-up, try writing the method public String recurseBackwards(String text), which should take a String as a parameter and return it backwards. It should, of course, do so recursively. You might want to try first writing public String iterBackwards(String text) which should do the same thing iteratively (with loops).

Another is to write a method called power(int a,int b) that is similar to Math.pow: it should take the number a to the b power. Assume that both numbers are positive integers. Don't use Math.pow, or you defeat the whole purpose of the exercise. Think carefully about how to do this with the least number of recursive calls. If you're smart, you should be able to do it with approximately log2b calls, instead of approximately b calls.

Other ideas are to write a recursive method to test if a String is a palindrome (the same forwards as backwards), or to take an array and determine the maximum value (but to do so recursively.)

Finally, if you want a bigger challenge, try to implement mergesort or quicksort (quicksort isn't on the exam, but ask for a quick explanation) without looking at sample code.