title: Converting an array of one type to an array of a subtype
body: <p>I want to convert an array from one type to another. As shown below, I loop over all objects in the first array and cast them to the 2nd array type.</p>
  
  <p>But is this the best way to do it? Is there a way that doesn't require looping and casting each item?</p>
  
  <pre><code>public MySubtype[] convertType(MyObject[] myObjectArray){
     MySubtype[] subtypeArray = new MySubtype[myObjectArray.length];
  
     for(int x=0; x &lt; myObjectArray.length; x++){
        subtypeArray[x] = (MySubtype)myObjectArray[x];
     }
  
     return subtypeArray;
  }
  </code></pre>