What will the following code print?
int [] myArray1 = { 1, 2, 3, 4, 5, 6}; int [] myArray2 = { 0, 0, 0, 0, 0, 0}; System .arraycopy (myArray2, 2, myArray1, 3, 2); for (int i : myArray2) System .out.print (i);
Select 1 option
Correct Option is : B
The arraycopy()
method basically copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array.
The last parameter is the number of elements that you want to copy.