Question: Here's what the layout is

```
index   num 
0      [10]
1      [20]
2      [30]
 (Add 35 here)
3      [40] Move elements down
4      [50]
5      [60]
6      [70]

```

then my method is this

```
public static void method(int[] num, int index, int addnum)
{

}

```

How can i add 35 in there?

Tried this:

```
public static void method(int[] num, int index, int addnum)
{
int index = 10;
for(int k = num.length k>3; k++)
{
        Num[k]=num[k++]
}
    Num[3] = 35;

```

Answer: 
As this is something you should accomplish yourself, I will only provide the method to implement it, not the code:

If you would set the number at position `index`, you would overwrite the value that was there previously. So what you need to do is move every element one position towards the end of the array starting from `index`: `num[x]` becomes `num[x+1]`, etc.

You will find out that you need to do this in reverse order, otherwise you will fill your array with the value in `num[index]`.

During this process you will need to decide what to do with the last entry of the array (`num[num.length - 1]`):

* You could just overwrite it, discarding the value
* You could return it from your function
* You could throw an exception if it is non-zero
* You could create a new array that is 1 entry larger than the current array instead to keep all values
* etc.

After this, you have duplicated `num[index]`: the value is present in `num[index+1]`, too, as you have moved it away.

Now it is possible to write the new value at the desired position without overriding an existing value.

**EDIT**

You have several errors in your code:

* You *increment* `k`, you need to *decrement* it (`k--`, not `k++`)
* You modify `k` again in your loop body: it is updated twice in each cycle
* If you start with `k = num.length`, you will try to write at `num[num.length + 1]`, which is not possible
What you're looking for is an [insertion sort](http://www.roseindia.net/java/beginners/arrayexamples/InsertionSort.shtml).

It's classwork, so it's up to you to figure out the proper code.