Hi friends
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));
}}
I know only how the int value is shifted by using any one of shift operator
Above pgm is hex value. That hex value first converted to int than it going to be shifted .am I right?
Convert to hex to int and than shifted is take more time to find the answer.
If suppose the real exam having like this means how to find a answer very fast as well as by easiest way
Please replay as soon as possible.
Preparing
SCJP(1.4)
(removed shouting from topic title)
[ May 10, 2005: Message edited by: Barry Gaunt ]