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