title: Formatting sorted data
body: <p>I have written the following code:</p>
  
  <pre><code>public void sortLastName() {
  
      ObjectList sortedList = new ObjectList();
  
      ObjectListNode p = database.getFirstNode();
  
      while (p != null) {
  
          Employee emp = (Employee) database.removeFirst();
  
          sortedList.insert(emp);
  
          p = database.getFirstNode();
  
      }
  
      database = sortedList.copyList();
  
      System.out.println("\nThe database, sorted by last name, is: ");
  
      pw.write("\nThe database, sorted by last name, is: \n");
  
      outputHeader();
  
      printSortedData();
  
  }
  </code></pre>
  
  <p>Now, when I compile this code (along with all the other code that goes along with it, the output looks nothing like what I want.  Is there any way to use printSotedData() while formatting the output a certain way.  Am I missing something extraordinarily simple?  Thanks in advance.</p>