Posts

Showing posts from March, 2013

Shift operator in java

Shift operator in java Java supports two types of shift operator (Logical Shift and Arithmetic shift). Logical Shift : In logical shift simply all the bits except the extreme left or right bit is moved by one place. and The extra bit from the other end is replaced with zero. For Example for The number 4 (binary = 0000 0100) Logical Shift ( >>>, << )                              original number        0 000 0100              (Decimal 4)                              after left shift           000 0100 0              (Decimal 8)                              original number         ...