title: Turn arraylist into array
body: <p>This is what I have so far</p>
  
  <pre><code>try{
            // Open the file that is the first 
            // command line parameter
            FileInputStream fstream = new FileInputStream("Patient.txt");
            // Get the object of DataInputStream
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String strLine;
            //Read File Line By Line
            List&lt;String&gt; lines = new ArrayList&lt;String&gt;();
            while ((strLine = br.readLine()) != null) {
  
            }
            //Close the input stream
            in.close();
              }catch (Exception e){//Catch exception if any
            System.err.println("Error: " + e.getMessage());
            }
      ArrayList&lt;Patient1&gt; patients=new ArrayList&lt;Patient1&gt;();
      Patient1 p = new Patient1();
      //set value to the patient object
      patients.add(p);
      System.out.println(p);
      // File i/o
  </code></pre>
  
  <p>This is my txt file</p>
  
  <pre><code>001, "John", 17, 100, 65, 110, 110, 110, 109, 111, 114, 113, "Swaying, Nausea"
  002, "Sun Min", 18, 101, 70, 113, 113, 110, 119, 111, 114, 113, "None"
  003, "Ray Allen", 25, 103, 74, 110, 110, 110, 109, 111, 108, 109, "Difficulty driving"
  004, "Michael Jordan", 26, 104, 84, 114, 115, 118, 117, 119, 120, 123, "Loss of        bladder control"
  005, "Kobe Bryant", 28, 110, 80, 118, 119, 120, 119, 120, 120, 120, "None"
  </code></pre>
  
  <p>I have all my methods and resources all i need to do is turn the array list into an array so I could do something like</p>
  
  <pre><code>    Patient1 average[] = {p[0], p[1], p[2], p[3], p[4]};
      int totalage = 0;
      double totalweight = 0;
      for (int i=0; i&lt;average.length; i++) {
      totalage = (average[i].getAge() + totalage);
      totalweight = (average[i].getWeight() + totalweight);
  </code></pre>