I am having a problem with conversion from hex and oct to decimal and vice versa. I am conversant with the values normally shown i.e 0xffff etc. But I wanted to know is there a shortcut to convert hex values like 0xf2f0. And more importantly, will such values be asked in the exam for bitshifting examples?
Look at the static conversion methods in Integer, Long and other wrapper classes. parseInt( String s, int radix ) will do base 8 and 16 from String to int. toHexString( int n ) toOctalString( int n ) toBinaryString( int n ) are handy too. You might see constants in hex format but I don't think they ever use octal in a question. Bill