Help coderanch get a
new server
by contributing to the fundraiser
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Ron McLeod
• Paul Clapham
• Devaka Cooray
• Liutauras Vilda
Sheriffs:
• Jeanne Boyarsky
• paul wheaton
• Henry Wong
Saloon Keepers:
• Stephan van Hulst
• Tim Holloway
• Tim Moores
• Carey Brown
• Mikalai Zaikin
Bartenders:
• Lou Hamers
• Piet Souris
• Frits Walraven

# Do we get such questions in Actual exam ...

Ranch Hand
Posts: 63
• Number of slices to send:
Optional 'thank-you' note:
How to handle questions that deal with Hexadecimals ?
(Applied reasoning mock test)
questions like
int a = 0x67
int b = 0xBD
a^b ....
also like
if(5|6).....
if (5^9) ....
what methods to tackle questions like these ...
Do we get such questions in actual exam ?

Greenhorn
Posts: 5
• Number of slices to send:
Optional 'thank-you' note:
I'm not SCJP, but I answer you YES
You have to read about Hex (0x...), Octal (0..) and about all bitwise operators.
For Hex, you can represent every digit in binary in 4 bits.
0x67 = 0110 0111
0xBD = 1011 1101
a^b = 1101 1010 = 0Xda = 0xDA
For the octal, you can represent every digit in binary in 3 bits.
128 64 32 16 8 4 2 1
1 1 0 1 1 0 1 0
128+64+16+8+2 = value in base 10.

Ranch Hand
Posts: 42
• Number of slices to send:
Optional 'thank-you' note:
YES,such question like that will come, because the objectives covers this.

Ranch Hand
Posts: 100
• Number of slices to send:
Optional 'thank-you' note:
Can someone please explain, with examples how to convert to
Hexadecimal and Octal.
In the SCJP Exam, will you have to convert into 32 bits or 8 bits ??? I am aware that all numeric datatyes that are smaller than int will be promoted to int.
Thanks in advance.

Ranch Hand
Posts: 51
• Number of slices to send:
Optional 'thank-you' note:
hexadecimal to octal conversion and vice versa
lets say x = 0x00ff
Step 1
Convert Hex to Binary
0000 0000 1111 1111
Step 2
After every 3 digits put a comma start from right to left
0,000 ,000,011, 111, 111
Step 3
Convert Binary to Octal
000377 (or) 0377 which is the octal equivalent for 0x00FF

Converting between octal and hex
Lets start at 0377
Step 1
convert to Binary
000 011 111 111
Step 2
After every 4 digits put a comma start from right to left
000 0,11 11,1 111
Step 3
Convert Binary to Hex
0FF
Ha, Ha magic worked
0377 = 0xFF
Hope this helps
Srini

Ranch Hand
Posts: 1874
• Number of slices to send:
Optional 'thank-you' note:
rather than thinking whether this will come in the exam or not , I feel you shoul better secure the risk. If it is part of Sun's objective , then nobody can stop them from asking questions on this type. So , do your best. Don't leave anything as option. You will come out with flying colours.
Apart from that No real Exam Questions shall be discussed in the forum , as you know it is policy of this forum. Plus , in doing so , Sun's Privacy Policy will get voilated. In my opinion , Any Responsible Javarancher will not allow to happen this.
So all the very best Srini.
Your Friendly Bartender
Shailesh.

 With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply