title: Possible to add more values to a full array?
body: <p>Imagine you have set array words to size 10.
  You call a method add(String word) ten times which adds 10 words to the array words.</p>
  
  <p>Imagine a user is asked how many words they want to add to an array (int n).
  I save this value, and create an array words of size n.
  A method add(String word) is called n times to add 10 different words to the array words.
  The user is then asked how many more words they want to add (int k).
  The method add(String word) is then called k more times.
  But array words is already full of words, and arrays are immutable, so I cant add any more words to that array.
  How would you go about this problem?
  Keeping in mind, there is no way of saving the users second value k, I can only access n, so I am also finding it difficult to create a new array of size k, because I don't know what size k is, and I am not meant to know.
  I know this problem could be easily solved using ArrayLists etc, but I have to use arrays.</p>
  
  <p>So basically, I need to add k more words to array of size n.</p>
  
  <p>My Code so far works for adding the first n words, but when it comes to adding the next k words, I get ArrayIndexOutOfBoundsException(k)...</p>
  
  <p>public class WordStoreImp
  {</p>
  
  <pre><code>private int counter=0;
  private int size;
  private String words[];
  
  public WordStoreImp(int n)
  {
      size=n;
      words=new String[n];
  }
  
  public void add(String word)
  {
      words[counter]=word;   
      counter++;
  }
  </code></pre>
  
  <p>any help? I know it may not even be possible btw lol</p>