Ok I am trying to do the following using an array.

Say I have one array

1 4 3 7 8

and at index 1 I want to place a 2 to get the following

1 2 4 3 7 8

How do I do this I think I have to make one array to keep everything before the index, one array to keep everything after the index.

And the add one more element to the array with everything before the index. The create a new longer array with everything before the index and everything after the index.

But I cannot seem to do it. This be what I tried.

//this program will test out how to replace an array with more stuff

```
public class Raton
  {
     public static void main(String[] args)
 {
        int[] gato={1,4,3,7,8};
        int[] perro = new int[gato.length+1];
        int[] biggie = new int[gato.length];

         int index=2; //store item index 2

    System.out.println("the contents of gato are ");

    for(int i=0; i<gato.length;i++)
    {
        System.out.println(gato[i]);
    }

    for(int i=0;i<gato.length;i++)
    {
        if(i<index)
        {
            perro[i]=gato[i];
        }
        else
        {
            int red=0;
            biggie[red]=gato[i];
            red++;
        }
    }

    //put two in the new place

         for(int i=0;i<perro.length;i++)
         {
           System.out.println(" \n the contents of peero are " + perro[i]);

      }
          for(int i=0; i<biggie.length;i++)
        {
        System.out.println("\nthe contents of biggie are " + biggie[i]);
        }
    }
}

```