Originally posted by Mani vannan:
Which edition of the book read? Checkout. It might be little old.
Originally posted by Cheenu Subramanian:
Ya Wendy.. U r right..
Float f=new Float("0x1") doesnt work.. Any idea ..why?
Originally posted by Cheenu Subramanian:
I assume the string parameter to the Float constructor has to be a valid number and not something like 1D or 1D or 1F. Even 1f doesnt work for me..Correct me if I am wrong
Originally posted by Steve Morrow:
Maybe I'm misunderstanding you, but the JLS specifies that the five lowest bits are used of the shift operand to determine the shift distance for int values (note that the six lowest bits are used for long values).
Originally posted by Surekha Reddy:
Hi,
Lets take this example.
int i = 10;
i = i << 35;
here 35 is not in the range of 0 to 31. So we can use lower 5 bits to calculate the shift distance.
35 -- 0000 0000 0000 0000 0000 0000 0010 0011
Here lower 5 bits are -- 00011. This is 3 in decimal.
This means i = i << 35 is equivalant to i = i << 3.
Please correct me if i'm wrong.
Regards,
Surekha.
Originally posted by Henry Wong:
And when it is not, only the lowest 5 bits are used to get it into that range.
Henry