/*
   This program demonstrates a simple counting loop using a while-loop.

   (Notice how there are four ways to decrement the counter.)
*/

public class CountDown
{
   public static void main( String[] args )
   {
      int i = 10;
      while (i > 0)
      {
         System.out.println( "T minus " + i + " and counting." );
         i = i - 1;
//       i -= 1;
//       i--;
//       --i;
      }
      System.out.println();



      // Here is a simplified version of the last loop.
      i = 10;
      while (i > 0)
      {
         System.out.println( "T minus " + i-- + " and counting." );
      }
      System.out.println();



      // How is the following loop different?
      i = 10;
      while (i > 0)
      {
         System.out.println( "T minus " + --i + " and counting." );
      }
      System.out.println();

   }//main()
}
