title: Best way to copy from one array to another
body: <p>When I run the following code, nothing gets copied - what am I doing wrong?</p>
  
  <p>Also, is this the best/most efficient way to copy data from one array to another?</p>
  
  <pre><code>public class A {
      public static void main(String args[]) {
          int a[] = { 1, 2, 3, 4, 5, 6 };
          int b[] = new int[a.length];
  
          for (int i = 0; i &lt; a.length; i++) {
              a[i] = b[i];
          }
      }
  }
  </code></pre>