Explain the use of shift operator in Java. Can you give some examples?
Using shift operators in Java we can
1. Integer division and multiplication is done faster.Example
84547 * 4 can be done by using 84547 << 2
84547 / 2 can be done by using 84547 >> 1
2. To reassemble byte streams into int values
3. To accelerate operations with graphics as Red, Green and Blue colors coded by separate bytes.