Practical Coding in Java

Learn to write and validate your own code

Darren Kessner, PhD

(revised September 1, 2025)

Previous: Octal

Exercises: Numeric Conversion

  1. Convert 1234 decimal to hexadecimal.   [0x4D2]

  2. Convert 0x321 hexadecimal to decimal.   [801]

  3. Convert 123 decimal to octal.   [173]

  4. Convert 321 octal to decimal.   [209]

  5. Convert 123 decimal to binary.   [1111011]

  6. Convert 123 decimal to binary using your answer from #2.

  7. Convert 801 decimal to binary.   [1100100001]

  8. Convert 801 decimal to binary using your answer from #1.

  9. Convert binary 111011001 to octal.   [731]

  10. Convert binary 11011010 to hex.   [0xDA]