title: How to create an append method for a char array in Java
body: <p>I'm currently working on a project for a class to create a TextLine class that represents the a line of text that must be represented as an array of characters.</p>
  
  <p>For one of the methods, I am supposed to take in a string as an argument of a parameter and then append that string to my already created char array. </p>
  
  <p>I was trying to search online for how I could do this, or even an example of the String or StringBuffer class that showed the implementation, but due to my novice skills at Google, I couldn't really find anything useful.</p>
  
  <p>What I 'm thinking is that I first have to convert the string to the array, and then somehow using one of the array methods to add each char individually to the char array. </p>
  
  <p>This is what I have:</p>
  
  <pre><code>public void append(String fragment){
  
      char[] temp = fragment.toCharArray();
  
  }
  </code></pre>
  
  <p>I'm not quite sure what array method could be used, if there even is one. Could someone please help me?</p>