title: How can I display my sorted array, names from binary file?
body: <p>I am having trouble with displaying my sorted array. I have a list of names that I sorted using different sorting algorithms. It is sorted when I use my own created string array. But if I try to sort an array that I imported from a file, it gives me the names in Binary form. </p>
  
  <pre><code>   //Read the names into an Array
  
        BufferedReader br = new BufferedReader(new FileReader(fileName));
        List&lt;String&gt; list = new ArrayList&lt;String&gt;();
        while ((names = br.readLine()) !=null)
        {
          list.add(names);
        }
  
         br.close();
        String[] name= list.toArray(new String[0]);
  
  
  
      BufferedReader user = new BufferedReader(new InputStreamReader(System.in)); 
  
      //Sort the array first
  
  
      //When i write this, it does not sort it, it just gives me names     //with no space 
      InsertionSort.insertionSort(name);
  
      System.out.println("\n Sorted Order:");
      for(String n : name)
          JOptionPane.showMessageDialog(null, n);
  
  
  
      //Ask the user for name to search
      JOptionPane.showInputDialog(null, "Enter a name to search for: ");
      String Name= user.readLine();
  
      user.close();
  </code></pre>