Update Left Right Shift in Java