Which is the best approach to copying elements from part of one array b to another array c? a) Use a for loop. b) Use b.clone( ). c) Use the assignment operator c = b. d) Use System.arraycopy
: : Which is the best approach to copying elements from part of one array b to another array c? : a) Use a for loop. : b) Use b.clone( ). : c) Use the assignment operator c = b. : d) Use System.arraycopy : :
//Either a or d. The for loop lets you copy part of an array quite easily, but if I understood the documentation on System.arraycopy right that one seems more efficient-
Comments
: Which is the best approach to copying elements from part of one array b to another array c?
: a) Use a for loop.
: b) Use b.clone( ).
: c) Use the assignment operator c = b.
: d) Use System.arraycopy
:
:
//Either a or d. The for loop lets you copy part of an array quite easily, but if I understood the documentation on System.arraycopy right that one seems more efficient-