I have problem with shift operator in Java.I have used following code and not unable to understand how this program generates this output.So please guide me how this program generates this output.
public class Operator {
public static void main(String[] args) {
// TODO Auto-generated method stub
int s = 8;
s = s >>-63;
System.out.println("value of i=" + s);
}
}
Output:
value of i=4
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…