title: how do I make a bigger array and copy over the info from the previous array in java?
body: <p>I'm trying to use to store info from a text file into a array, but the project asks us to do so by making a temporary array and increasing its size as we read more files to accomadate for the new objects. How can I do this?</p>
  
  <pre><code>/**
   * reads a csv data file and returns an array of acquaintances
   * @param path File path of CSV file
   * @return Acquaintances from the file
   */
  public static Acquaintance[] read (String path)  {
      //create an array of acquaintances 
      Acquaintance[] acqs = new Acquaintance[0];
  
      //open the file
      try {
          BufferedReader file = new BufferedReader(new FileReader(path));
  
          //read the file until the end
          String line;
  
          while( (line = file.readLine()) != null) {
              // parse the line just read
              String[] parts = line.split(",");
  
              //create an acquaintance object
              Acquaintance a = new Acquaintance(parts[0], parts[1], Double.parseDouble(parts[2]));
  
              acqs[0] = a;
  
              //Add the object to the array
  
              //(1) create a new Acquaintance array, with one extra element
              Acquaintance[] tmp = new Acquaintance[acqs.length+1];
  
              //(2) copy all old elements into new
              Acquaintance[] tmp = acqs.clone();
  
              //(3) assign new Acquaintance object to last element of the array
  
              //(4) assign new array's address to acqs
              //for loop
          }
  </code></pre>