giovedì 28 marzo 2013

Q42


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

Risposta : F
L'array passa da { 1, 2, 3, 4, 5 }  a { 1, 3, 4, 4, 5 } e si stampano gli elementi 1 e 4 cioè 35.

 

Nessun commento:

Posta un commento