title: Sorting an array of zeros, negative and positive numbers
body: <p>I have an array in Java</p>
  
  <pre><code>int num[] = {5, -3, 0, -18, 1, 2, 0};
  </code></pre>
  
  <p>I want to make it look like these</p>
  
  <pre><code>{-3, -18, 0, 0, 5, 1, 2}
  </code></pre>
  
  <p>What I have right now is this</p>
  
  <pre><code>for (int i=0; i&lt;num.length;i++)
      {
          for (int j=1; j&lt;num.length-1;j++)
          {
              if (num[j]&lt;0)
              {
                  temp=num[j];
                  c=num[j-1];
                  num[j-1]=temp;
                  num[j]=c;
              } 
          }  
      }
  </code></pre>
  
  <p>But this sort just negative numbers, and I can't find solution how to sort zeros. 
  Can you help me, please?</p>