Quiz 11 (Exercise for Chap. 17)

  1. (Big Java 17.1) Write a recursive method String reverse() that returns the reverse of the String instance variable of Sentence. For example:
        Sentence greeting = new Sentence("Hello!");
        System.out.println(greeting.reverse() );
    prints the string "!olleH". Implement a recursive solution by removing the first character, reversing a sentence consisting of the remaining text, and combining the two.
  2. (Big Java 17.2) Redo the above with a recursive helper method that reverses a substirng of the message.