File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Conversion" Watch "Conversion" New topic


Javix Protocol
Ranch Hand

Joined: Mar 21, 2000
Posts: 57
How to convert a decimal integer literal to octal and hexadecimal literal?

Write Once , Run Anytime ,Anywhere Forever And Smile Happily.
Jesper Ottosson
Ranch Hand

Joined: Mar 21, 2000
Posts: 51
the decimal number 20 is:
0x14 in hex
024 in oct
so just prefix with 0x when you want hexadecimal and 0 when you want octal
I agree. Here's the link:
subject: Conversion
It's not a secret anymore!