wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Hexidecimal and octal question!! 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 "Hexidecimal and octal question!!" Watch "Hexidecimal and octal question!!" New topic
Author

Hexidecimal and octal question!!

Edmund Chiang
Greenhorn

Joined: Apr 11, 2001
Posts: 17
How do you convert a decimal to hexidecimal or octal?
How do you convert a hexidecimal or octal back to decimal?
Example: how do you convert decimal 100?
Thanks in Advance!
Edmund
Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241

returns

Notice that when converting from octal to decimal, you don't need the leading zero in the String. Similarly, conversion from hexadecimal to decimal does not require (or allow) a leading "0X" or "0x".
Art
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hexidecimal and octal question!!