class ShiftOperatorMathDemo
{
   public static void main(String[] args)
   {
      System.out.println("shift left to multiply by 2 quickly by using << 1");
      for(int i = 0; i < 8; i++)
      {
          System.out.println("before shift, the value is: " + i);
          i = i << 1;
          System.out.println(i);
      }

      System.out.println("shift left to multiply by 4 quickly by using << 2");
      for(int i = 0; i < 8; i++)
      {
          System.out.println("before shift, the value is: " + i);
          i = i << 2;
          System.out.println(i);
      }

      System.out.println("shift left to multiply by 8 quickly by using << 3");
      for(int i = 0; i < 8; i++)
      {
          System.out.println("before shift, the value is: " + i);
          i = i << 3;
          System.out.println(i);

                    i = i << 3;
          System.out.println(i);
      }
   }
}
