class EBH019 {
public static void main (
String args[]) {
int i1 = 0xffffffff, i2 = i1 << 1;
int i3 = i1 >> 1, i4 = i1 >>> 1;
System.out.print(Integer.toHexString(i2) + ",");
System.out.print(Integer.toHexString(i3) + ",");
System.out.print(Integer.toHexString(i4));
}}
output Prints: fffffffe,ffffffff,7fffffff
according to me output shud be
Prints: fffffffe,7fffffff,7fffffff
howcome i1 and i3 have the same output even though shift operator is used on i3 ?? also being positive numbers the use of >> & >>> should be the same on both the variables
Please point out where i,am going wrong !!
thanks