Function for converting octal to hexadecimal in Java -


Is there a function that I can use to convert octal to hexadecimal to Java?

There is no single method, but you can easily do it through two steps: < / P>

  • Your string has an octal value in which a int (or long , depending on expected category)
  • Format int / long a hexadecimal string .

    Using those two steps can be done and done respectively. Be sure to use two-logic versions and pass 8 and 16 respectively for octaves and hexadecimal.

Comments