This Java tip illustrates a method of copying elements of one array into another array. Developers may sometimes need to transfer the data in source array into target array for some other use. This tip may be helful for them.

  System.arraycopy(sourcearray, 0, targetarray, 0, 
            Math.min(sourcearray.length, targetarray.length));