0: Jon Smith, 555-1212 1: Mary Jane, 555-1234 3: Sam Lee, 555-9876Use a loop that starts at index 0 and calls get(index) to get the PhoneEntry at each possible index. The loop should print the PhoneEntry value that is returned. The loop should catch a NullPointerException, print nothing if such an exception occurs, and move on to try the next index. To do this, you may need to change the code that builds the string you will print so that it calls the toString method of the PhoneEntry object directly. That is, if you have a PhoneEntry e, and if your code has something like System.out.println("entry is " + e); then you will have to change it to System.out.println("entry is" + e.toString());. The routine should also catch an ArrayIndexOutOfBoundsException which indicates that the index tested is beyond the length of the directory, and when the exception occurs the loop should terminate.
When you are finished, email your code to me.