title: Java(BlueJ) Adding up all numbers between two integers
body: <p>I'm creating a method to add up all numbers between two integers.
  I currently have:</p>
  
  <pre><code>/**
   * Add up all numbers between two integers
   */
  public void Sum(int a,int b)
  {
     int result = 0;
      while (a &lt;=b) 
      {
          result+=a;
          a++; 
      }   
  
      System.out.println("The sum of all numbers is "+result); 
  }
  </code></pre>
  
  <p>This only works if <code>a &lt;= b</code>. How do i also do it for if <code>a &gt; b</code> ?</p>
  
  <p>I have to use a while loop</p>