title: appending char to char array java
body: <p>I'm trying to write a method that takes in and a returns a character array.  I want to replace every space ' ' with 'h''i'.  I can't use the string class or any other helper classes.  I'm getting stuck when at "total+= ch;" since they are two different types.<br>
  What i want</p>
  
  <pre><code>char[] characterStr = {'w','h','a','t','s',' ','u','p'}
  System.out.println(characterStr);
  System.out.println(Space(characterStr));
  
  whats up
  whatshiup
  </code></pre>
  
  <p>my code so far:</p>
  
  <pre><code>public static char[] Space(char[] input){
      char[] total;
  
      for(char ch: input){
          if(ch==' '){
              ch = 'h'+'i';
              total += ch;
          }
          else{
              total += ch;
          }
  
      return total;
  </code></pre>