title: Decrease a variable until a number is reached in java
body: <p>I have this class:</p>
  
  <pre><code>public class Vehicle {
      private float speed;
  
       public void decelerationSpeed()
       {
           --speed;
       }  
  }
  </code></pre>
  
  <p>Each time <code>decelerationSpeed</code> method have been called speed variable decreased by one.</p>
  
  <p>I need to change <code>decelerationSpeed</code> method this way that, if speed variable reached to zero and <code>decelerationSpeed</code> method have been called the speed value doesn't have to be changed.</p>
  
  <p>In this tutorial I can't use if else or any other conditional operators(I think I have to manipulate with modulo and divide operations).</p>