Question: What is copiedNums' length after the code segment? int[] originalNums = {1,2,3,4,5}; int[] copiedNums; copy(originalNums, 3); ... public static int[] copy(int[] nums, int changeAmt) {
What is copiedNums' length after the code segment?
int[] originalNums = {1,2,3,4,5}; int[] copiedNums; copy(originalNums, 3); ... public static int[] copy(int[] nums, int changeAmt) { int[] modifiedNums = new int[nums.length * changeAmt]; int index; for(index = 0; index < nums.length; ++index){ modifiedNums[index] = nums[index]; } return modifiedNums; }
a)null
b)5
c)15
d)0
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
