kalpana,
Kathy and Bert�s book (Sun Certified Programmer and Developer for
Java 2 Study Guide (Exams 310-035 and 310-027))shows you exactly how it works.
But to summarize:
To determine the result of left shifting expression 16 >> 3 you do 16 divided by (2 to the power of 3) or 16/8 = 2. So 16 >> 3 = 2.
To determine the result of right shifting expression 8 << 4 you do 12 multiply by (2 to the power of 4) or 8*16 = 128. So 16 << 3 = 128.
I hope this will answer your question.
Christian
[ December 05, 2005: Message edited by: Christian Robitaille ]
[ December 05, 2005: Message edited by: Christian Robitaille ]