title: Creating objects via txt file into an array in Java
body: <p>I am trying to complete a little program.</p>
  
  <p>I've got a text file (.txt) to store different data on objects that i've got.</p>
  
  <p>The structure of the file is the next (exemples data.txt) :</p>
  
  <ul>
  <li>Sedane </li>
  <li>2005 </li>
  <li>195000 </li>
  <li>Diesel </li>
  <li>Blue </li>
  <li>SUV </li>
  <li>2013 </li>
  <li>34000 </li>
  <li>Fuel </li>
  <li>Black</li>
  </ul>
  
  <p>Each object is made true a class that i've build called Cars.
  So the 1 line is the type of car, the 2nd the year of built, the 3rd line is the milage, the 4th is the type of fuel, and the 5th line is the color of the car.</p>
  
  <p>So basicly i need to open the file, and load the data into the memory when i execute my program into an array with object in it.</p>
  
  <p>I'm ok to open the file but i'm blocked when it comes to reading the data and putting it in an array.</p>
  
  <p>The array size is 2 for this exemple, but if i have more entries in the file it's going to adapt it's size when loading at the startup of the program.</p>
  
  <p>Here's what i've got unti now (for my code ...)</p>
  
  <pre><code>public static void loadCars () {
      FileReader fopen;
      BufferedReader opened;
      String line;
  
      try {
          fEntree = new FileReader( "data.txt" );
          opened = new BufferedReader( fopen );
          while ( opened.ready() ) {
              line = opened.readLine();
              // Don't know what to do here ????
          }
          opened.close();
      } catch ( IOException e ) {
          System.out.println( "File doesn't exist !" );
      }
  
  }
  </code></pre>