title: Reading data as an object and inputing into an Object array
body: <p>The overarching theme of this project is to sort stuff. My full code works (sort of) but the issue is that it always sorts my data as a String and I am pretty sure its caused by that fact that I am reading the dataFile's line as a String and inputting that into the array as a string. </p>
  
  <pre><code>Object[] list = new Object[n];
  
      if (n &gt; 0) {
  
          try {
              BufferedReader file = new BufferedReader(new FileReader("dataFile.txt"));
  
              for (int i = 0; i &lt; list.length; i++) {
                  String t = file.readLine();
                  if (t != null)
                      list[i] = t;
              }
              file.close();
          }
  
          catch (FileNotFoundException e) {
              System.out.println("Error accessing file.");
          } catch (IOException io) {
              System.out.println("There was an error reading from the file.");
          }
      }
  </code></pre>
  
  <p>If someone could point me in the correct direction on how to read a line and input it into an array as an Object, I would be grateful.</p>