Write a method called doubleSize that accepts an integer array as a parameter and returns a reference to a new integer array that is twice as long and contains all of the elements of the first array in the same positions.

What will be an ideal response?

```
public int[] doubleSize(int[] originalArray) {
int[] newArray = int[originalArray.length*2];
for(int i = 0; i < originalArray.length; i++)
newArray[i] = originalArray[i];
return newArray;
}
```

Computer Science & Information Technology

You might also like to view...

A PowerPoint presentation is saved with a ________ file extension

Fill in the blank(s) with correct word

Computer Science & Information Technology

You have a Class B network and need 29 subnets. What is your mask?

A) /30 B) /25 C) /24 D) /21

Computer Science & Information Technology