File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Numerical conversions in SCJP exam? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Numerical conversions in SCJP exam?" Watch "Numerical conversions in SCJP exam?" New topic
Author

Numerical conversions in SCJP exam?

dennis zined
Ranch Hand

Joined: Mar 07, 2003
Posts: 330
Hello. I'm studying for the scjp. Does anybody here know whether or not numerical conversions are included in the exam? like binary to decimal, decimal to binary, octal to hex, hex to octal, hex to binary, etc.


SCJP 1.4<br />SCWCD 1.4
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Dennis,
The four bases, binary, octal, decimal, and hexadecimal, appear on the exam so a familiarity with all four is certainly advantageous.
Digital computers work with binary values. We humans learned how to count using our fingers so base 10, decimal, is the number system that we prefer. Unfortunately, conversions between the two number systems are not as easy as we would like. In contrast, conversions are very easy between binary and any number system with a base that is a multiple of two. Examples would be bases 4, 8, and 16.
From a human point of view, base 4 isn't a lot more readable than base 2. The next choice, base 8 (octal), is preferable because it uses nearly all of the digits that we are familiar with--0, 1, 2, 3, 4, 5, 6 and 7. Using base 8, a byte of binary data can be conveniently converted to octal just by arranging the bits as a series of three nibbles and by converting the nibbles separately to octal. The binary value, 11111111, can be written as the following 3 nibbles--11 111 111. The first nibble, 11, is represented in octal as 3. The second nibble, 111, is represented in octal as 7. The entire series of three binary nibbles are represented in octal as 377.
By moving to hexadecimal the size of the nibble can be increased to four bits. The eight bit binary value, 01100111, can be organized as two nibbles as follows--0110 0111. The first nibble is represented in hexadecimal as 6. The second nibble is represented in hex as 7. The sequence of the two nibbles is represented in hexadecimal as 67.
My web site has a short base conversion tutorial.
The Cat and Mouse Game with Bits here at the JavaRanch is also helpful.
[ March 09, 2003: Message edited by: Dan Chisholm ]

Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
dennis zined
Ranch Hand

Joined: Mar 07, 2003
Posts: 330
thanks Dan!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Numerical conversions in SCJP exam?
 
Similar Threads
Computer Arithmetic
Octal
Hex and Octal
binary, hex & octal
Mock exams?