Question: 9 . 4 . 5 : Complete the code to make a copy of the first half of an array. 5 9 7 7 1
: Complete the code to make a copy of the first half of an array.
qxzqy
Complete the following code to make a copy of the first half of an array of strings.
import java.util.Arrays;
public class CopyHalf
Copies the first half of an array. If the length is odd,
don't copy the middle value.
@param values an array
@return a copy of the first half of values
public static Your code goes here copyHalfString values
Your code goes here
public static void mainString args
String arr "Mary", "had", a "little", "lamb" ;
System.out.printlnFull Array : Arrays.toStringarr;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
