Question: Given the fragment: int[] array = {1,2,3,4,5}; System.arraycopy(array,2,array,1,2); System.out.print(array[1]); System.out.print(array[4]); What is the result? a. 14 b. 15 c. 24 d. 25 e. 34 f.

Given the fragment:

int[] array = {1,2,3,4,5};

System.arraycopy(array,2,array,1,2);

System.out.print(array[1]);

System.out.print(array[4]);

What is the result?

a. 14

b. 15

c. 24

d. 25

e. 34

f. 35

The answer is 35.

Can you explain this to me? I have no idea how this works.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!