Why is the shift operation by a -ve value ,not a compiler error.(eg: 12 >> -2)? It compiles fine and gives 0 as o/p. Pl.clarify.
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
posted
0
Doing a shift by a negative number is not a compiler error. It is a legal operation in Java. Do a search in this forum as this topic has been discussed many times. Corey