Is there any limitation in bit shifting?
public static void main(String args[])
{
int i=10;
System.out.println(i<<32);
}
Output is 10
But I know its incorrect.
Answer should be 10*232 = 4.29*1010
Why is this?
Is there any limitation in bit shifting?
public static void main(String args[])
{
int i=10;
System.out.println(i<<32);
}
Output is 10
But I know its incorrect.
Answer should be 10*232 = 4.29*1010
Why is this?
Yes, the shift-factor is modulo'ed by:
char
, short
or int
.long
.