Suppose that I have the following declarations:
int[ ] data = new int[100];
int i;
Write a small segment of Java code that will shift data[50]...data[98]
up one spot to the locations data[51]...data[99]. Then insert the number
42 at location data[50]. Use a for loop (not System.arraycopy).
Solutions: