title: Java: Copy array of Integers into Array of Strings
body: <p>Consider a method whose signature contains an <code>Integer</code> Array:</p>
  
  <pre class="lang-java prettyprint-override"><code>public static void parse(Integer[] categories)
  </code></pre>
  
  <p><code>parse</code> needs to call a different method, which expects an Array of Strings. So I need to convert <code>Integer[]</code> to <code>String[]</code>. </p>
  
  <p>For example, <code>[31, 244] ⇒ ["31", "244"]</code>.</p>
  
  <p>I've tried Arrays.copyOf described <a href="https://stackoverflow.com/questions/1018750/how-to-convert-object-array-to-string-array-in-java">here</a>:</p>
  
  <pre class="lang-java prettyprint-override"><code>String[] stringArray = Arrays.copyOf(objectArray, objectArray.length, String[].class);
  </code></pre>
  
  <p>But got an <code>ArrayStoreException</code>.</p>
  
  <p>I can iterate and convert each element, but is there a more elegant way?</p>