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...

Your organization needs to deploy its network so that all servers are isolated from the rest of the internal resources. In addition, Internet-facing systems must be isolated on a demilitarized zone (DMZ) from the internal network. How many firewalls should you deploy?

A. one B. two C. three D. four

Computer Science & Information Technology

Which of the following can be used to set options such as TFTP server addresses, DNS search lists, and broadcast addresses on network clients and workstations?

A. Networkbridge B. Layer 2 switch C. DHCP server D. Smart jack

Computer Science & Information Technology