This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


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

Conversion

Javix Protocol
Ranch Hand

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


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
 
Don't get me started about those stupid light bulbs.
 
subject: Conversion
 
Similar Threads
The .class property
Literals???
Did you hear the one ... ?
(heavy breathing goes here)
Is "null" a keyword in Java?