This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hexidecimal and octal question!!

 
Edmund Chiang
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic