الرجوع
تسجيل الدخول

What is copiedNums length after the code segment?

int[] originalNums = {1, 2, 3, 4, 5};
int[] copiedNums;
copiedNums = copy(originalNums, 2);
public static int[] copy(int[] nums, int changeAmt) {
    int[] modifiedNums = new int[nums.length * changeAmt];
    for (int index = 0; index < nums.length; ++index) {
        modifiedNums[index] = nums[index];
    }
    return modifiedNums;
}