I have an array in Java

```
int num[] = {5, -3, 0, -18, 1, 2, 0};

```

I want to make it look like these

```
{-3, -18, 0, 0, 5, 1, 2}

```

What I have right now is this

```
for (int i=0; i<num.length;i++)
    {
        for (int j=1; j<num.length-1;j++)
        {
            if (num[j]<0)
            {
                temp=num[j];
                c=num[j-1];
                num[j-1]=temp;
                num[j]=c;
            } 
        }  
    }

```

But this sort just negative numbers, and I can't find solution how to sort zeros. 
Can you help me, please?